summaryrefslogtreecommitdiff
path: root/luaotfload-extralibs.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-06-22 12:38:04 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-06-22 12:38:04 +0200
commitdbe92b0e0e771352c4307ff3eb8f04f9cfd8ec02 (patch)
tree85c041065c4a24e3a32cc81d198736cfde245820 /luaotfload-extralibs.lua
parent51360bd326da1e0fcb10b1b311b49284ec480ed5 (diff)
downloadluaotfload-dbe92b0e0e771352c4307ff3eb8f04f9cfd8ec02.tar.gz
add unsafe fallback to character data lookup
Diffstat (limited to 'luaotfload-extralibs.lua')
-rw-r--r--luaotfload-extralibs.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/luaotfload-extralibs.lua b/luaotfload-extralibs.lua
index 90dbf09..3204229 100644
--- a/luaotfload-extralibs.lua
+++ b/luaotfload-extralibs.lua
@@ -176,9 +176,15 @@ if not chardata then
if k == true then
return chardata[currentfont()]
else
- local characters = identifiers[k].characters
- t[k] = characters
- return characters
+ local tfmdata = identifiers[k]
+ if not tfmdata then --- unsafe
+ tfmdata = font.fonts[k]
+ end
+ if tfmdata then
+ local characters = tfmdata.characters
+ t[k] = characters
+ return characters
+ end
end
end)
fonthashes.characters = chardata