diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-03-04 06:50:56 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-03-04 06:50:56 +0100 |
commit | dea1714fbd825b67b8116ca20fd8e5464af79f29 (patch) | |
tree | 43e841438787a24e05c971c5cc066831c05f4f84 | |
parent | 959794804e53aaea76298cba35ccb6c3f347fb1c (diff) | |
download | luaotfload-dea1714fbd825b67b8116ca20fd8e5464af79f29.tar.gz |
[db] treat missing fontname as invalid font
-rw-r--r-- | src/luaotfload-database.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 923f7c5..54738df 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1346,6 +1346,7 @@ end --- find_closest() local load_font_file = function (filename, subfont) local rawfont, _msg = fontloaderopen (filename, subfont) + --local rawfont, _msg = fontloaderinfo (filename, subfont) if not rawfont then report ("log", 1, "db", "ERROR: failed to open %s.", filename) return @@ -1406,12 +1407,13 @@ end --]]-- local get_raw_info = function (metadata, basename) local fullname - local fontname + local fontname = metadata.fontname + local fullname = metadata.fullname local psname local validation_state = metadata.validation_state - if validation_state - and tablecontains (validation_state, "bad_ps_fontname") + if (validation_state and tablecontains (validation_state, "bad_ps_fontname")) + or not fontname then --- Broken names table, e.g. avkv.ttf with UTF-16 strings; --- we put some dummies in place like the fontloader @@ -1421,9 +1423,6 @@ local get_raw_info = function (metadata, basename) basename) fontname = "bad-fontname-" .. basename fullname = "bad-fullname-" .. basename - else - fontname = metadata.fontname - fullname = metadata.fullname end return { @@ -1541,7 +1540,7 @@ local organize_styledata = function (fontname, metadata, english_names, info) - local pfminfo = metadata.pfminfo + local pfminfo = metadata.pfminfo or { } local names = metadata.names return { |