summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-10 16:34:12 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-10 16:34:12 +0200
commitce418e183f6fed281940def9b848258c8b25916e (patch)
tree45bb20db6ef2b0029b30c1b5666bd77efe6e432b
parentbc5de9881dfe0b3d1f81f13d4c5428d818a7b662 (diff)
downloadluaotfload-ce418e183f6fed281940def9b848258c8b25916e.tar.gz
[rfc] proposal for font name fallback
-rw-r--r--luaotfload-auxiliary.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua
index c08f775..8d12d11 100644
--- a/luaotfload-auxiliary.lua
+++ b/luaotfload-auxiliary.lua
@@ -31,6 +31,7 @@ local stringlower = string.lower
local stringformat = string.format
local stringgsub = string.gsub
local stringbyte = string.byte
+local stringmatch = string.match
-----------------------------------------------------------------------
--- font patches
@@ -64,6 +65,9 @@ local add_fontdata_fallbacks = function (fontdata)
else --- otf
metadata = fontdata.shared.rawdata.metadata
+ fontdata.name = fontdata.name
+ or fontdata.fullname
+ or fontdata.psname
fontdata.units = fontdata.units_per_em
local resources = fontdata.resources
--- the next line is a hack that fixes scaling of fonts with
@@ -98,8 +102,6 @@ end
--if config.luaotfload.compatibility == true then
if true then
- --- this will cause the output pdf to be garbled
- --- in pdf.js
luatexbase.add_to_callback(
"luaotfload.patch_font",
add_fontdata_fallbacks,