From 42180261320683ea265631d44024ba698286dba8 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 15 Feb 2010 16:43:01 +0200 Subject: 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. --- luaotfload-fonts.lua | 20 ++++++++++++++------ 1 file 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) -- cgit v1.2.3