diff options
| author | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-15 16:43:01 +0200 | 
|---|---|---|
| committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-15 16:59:17 +0200 | 
| commit | 42180261320683ea265631d44024ba698286dba8 (patch) | |
| tree | 2076e82db0efdbafec9f54c8d226c6db21ced282 | |
| parent | 7557e659792fcc9a9a2d5f4d400605ea6cfdd6df (diff) | |
| download | luaotfload-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.
| -rw-r--r-- | luaotfload-fonts.lua | 20 | 
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) | 
