summaryrefslogtreecommitdiff
path: root/luaotfload-fonts.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-02-15 16:43:01 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-02-15 16:59:17 +0200
commit42180261320683ea265631d44024ba698286dba8 (patch)
tree2076e82db0efdbafec9f54c8d226c6db21ced282 /luaotfload-fonts.lua
parent7557e659792fcc9a9a2d5f4d400605ea6cfdd6df (diff)
downloadluaotfload-42180261320683ea265631d44024ba698286dba8.tar.gz
Guard against fonts with broken names table
Due to a bug in current luatex, some fonts would lack certain required entries in names table, now we'll just ignore such fonts. The real bug is fixed in luatex trunk anyway.
Diffstat (limited to 'luaotfload-fonts.lua')
-rw-r--r--luaotfload-fonts.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/luaotfload-fonts.lua b/luaotfload-fonts.lua
index 9437023..a79a18b 100644
--- a/luaotfload-fonts.lua
+++ b/luaotfload-fonts.lua
@@ -106,10 +106,14 @@ local function load_font(filename, names, texmf)
fullinfo.filename = basename(filename)
end
mappings[#mappings+1] = fullinfo
- if not families[fullinfo.names.family] then
- families[fullinfo.names.family] = { }
+ if fullinfo.names.family then
+ if not families[fullinfo.names.family] then
+ families[fullinfo.names.family] = { }
+ end
+ table.insert(families[fullinfo.names.family], #mappings)
+ else
+ log(3, "Warning: font with broken names table: %s, ignored", filename)
end
- table.insert(families[fullinfo.names.family], #mappings)
end
else
local fullinfo = fontloader.fullinfo(filename)
@@ -117,10 +121,14 @@ local function load_font(filename, names, texmf)
fullinfo.filename = basename(filename)
end
mappings[#mappings+1] = fullinfo
- if not families[fullinfo.names.family] then
- families[fullinfo.names.family] = { }
+ if fullinfo.names.family then
+ if not families[fullinfo.names.family] then
+ families[fullinfo.names.family] = { }
+ end
+ table.insert(families[fullinfo.names.family], #mappings)
+ else
+ log(3, "Warning: font with broken names table: %s, ignored", filename)
end
- table.insert(families[fullinfo.names.family], #mappings)
end
else
log(1, "Failed to load %s", filename)