diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-07 08:11:33 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-07 08:11:33 +0100 |
commit | 72692325b88bda53a115e62c66b321253297533b (patch) | |
tree | b776f81511e6aa0d28165a1ad6e5ed1ea86a7165 | |
parent | c88eb25bd287941119e1db0f52919e4beccb0114 (diff) | |
parent | 20e5ffb1360a102ac52e3a0a99513499051318b8 (diff) | |
download | luaotfload-72692325b88bda53a115e62c66b321253297533b.tar.gz |
Merge pull request #191 from phi-gamma/texlive2014
sync with Context; handle broken ps names
-rw-r--r-- | luaotfload-database.lua | 31 | ||||
-rw-r--r-- | luaotfload-fontloader.lua | 10 | ||||
-rw-r--r-- | luaotfload-tool.rst | 3 |
3 files changed, 37 insertions, 7 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 023d5f8..77a7162 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -105,6 +105,7 @@ local stringis_empty = string.is_empty local stringsplit = string.split local stringstrip = string.strip local tableappend = table.append +local tablecontains = table.contains local tablecopy = table.copy local tablefastcopy = table.fastcopy local tabletofile = table.tofile @@ -1331,6 +1332,13 @@ end --- find_closest() <http://www.ntg.nl/pipermail/ntg-context/2013/075885.html> regarding the omission of ``fontloader.close()``. + TODO -- check if fontloader.info() is ready for prime in 0.78+ + -- fields /tables needed: + -- names + -- postscriptname + -- validation_state + -- .. + --doc]]-- local load_font_file = function (filename, subfont) @@ -1365,8 +1373,24 @@ local get_size_info = function (metadata) return false end -local get_english_names = function (names, basename) +local get_english_names = function (metadata, basename) + local validation_state = metadata.validation_state + if validation_state + and tablecontains (validation_state, "bad_ps_fontname") + then + report("both", 3, "db", + "%s has invalid postscript font names, using dummies.", + basename) + --- Broken names table, e.g. avkv.ttf with UTF-16 strings; + --- we put some dummies in place like the fontloader + --- (font-otf.lua) does. + return { + fontname = "bad-fontname-" .. basename, + fullname = "bad-fullname-" .. basename, + } + end + local names = metadata.names local english_names if names then @@ -1396,7 +1420,7 @@ local organize_namedata = function (metadata, or english_names.postscriptname or metadata.fullname or metadata.fontname - or info.fullname --- TODO check if fontloader.info() is ready for prime + or info.fullname or info.fontname local default_family = english_names.preffamily or english_names.family @@ -1467,7 +1491,6 @@ local organize_namedata = function (metadata, fullname = metadata.fullname, familyname = metadata.familyname, } - end @@ -1523,7 +1546,7 @@ ot_fullinfo = function (filename, return nil end - local english_names = get_english_names (metadata.names, basename) + local english_names = get_english_names (metadata, basename) local namedata = organize_namedata (metadata, english_names, basename, diff --git a/luaotfload-fontloader.lua b/luaotfload-fontloader.lua index 3986118..8c31750 100644 --- a/luaotfload-fontloader.lua +++ b/luaotfload-fontloader.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 02/01/14 14:22:42 +-- merge date : 02/07/14 00:57:35 do -- begin closure to overcome local limits and interference @@ -6450,7 +6450,7 @@ local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf otf.glists={ "gsub","gpos" } -otf.version=2.750 +otf.version=2.751 otf.cache=containers.define("fonts","otf",otf.version,true) local fontdata=fonts.hashes.identifiers local chardata=characters and characters.data @@ -6602,6 +6602,7 @@ local valid_fields=table.tohash { "upos", "use_typo_metrics", "uwidth", + "validation_state", "version", "vert_base", "weight", @@ -7914,6 +7915,11 @@ actions["check metadata"]=function(data,filename,raw) ttftables[i].data="deleted" end end + if metadata.validation_state and table.contains(metadata.validation_state,"bad_ps_fontname") then + local name=file.nameonly(filename) + metadata.fontname="bad-fontname-"..name + metadata.fullname="bad-fullname-"..name + end end actions["cleanup tables"]=function(data,filename,raw) data.resources.indices=nil diff --git a/luaotfload-tool.rst b/luaotfload-tool.rst index be53ded..2ac206f 100644 --- a/luaotfload-tool.rst +++ b/luaotfload-tool.rst @@ -193,7 +193,8 @@ miscellaneous directory (the name will be chosen automatically (**experimental!**). ---version, -V Show version number and exit. +--version, -V Show version numbers of components as well as + some basic information and exit. --help, -h Show help message and exit. --diagnose=CHECK Run the diagnostic procedure *CHECK*. Available |