summaryrefslogtreecommitdiff
path: root/otfl-font-nms.lua
diff options
context:
space:
mode:
authorOlof-Joachim Frahm <olof@macrolet.net>2012-10-23 23:42:44 +0300
committerOlof-Joachim Frahm <olof@macrolet.net>2012-10-23 23:42:44 +0300
commit5bba2ed9b294bca8c8b7afcbbc1f2dea990c5eb5 (patch)
tree6f12bbd83dd741bcbda08777dc12240b902254b0 /otfl-font-nms.lua
parent9291e1983240e72d93815a096963dc28a7acd770 (diff)
downloadluaotfload-5bba2ed9b294bca8c8b7afcbbc1f2dea990c5eb5.tar.gz
Handle missing names properly.
For some (possibly broken) fonts, e.g. Gentoo's media-fonts/twmoefonts, the names field is nil, thus breaking lookup even for other fonts. Defaulting to nil if the field is missing fixes this problem.
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r--otfl-font-nms.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 8290e17..87f4987 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -118,10 +118,10 @@ function names.resolve(_,_,specification) -- the 1st two parameters are used by
if data.mappings then
local found = { }
for _,face in next, data.mappings do
- local family = sanitize(face.names.family)
- local subfamily = sanitize(face.names.subfamily)
- local fullname = sanitize(face.names.fullname)
- local psname = sanitize(face.names.psname)
+ local family = sanitize(face.names and face.names.family)
+ local subfamily = sanitize(face.names and face.names.subfamily)
+ local fullname = sanitize(face.names and face.names.fullname)
+ local psname = sanitize(face.names and face.names.psname)
local fontname = sanitize(face.fontname)
local pfullname = sanitize(face.fullname)
local optsize, dsnsize, maxsize, minsize