From e133632df9fc035af0deaad333305815047c8b0a Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 6 Feb 2010 23:19:17 +0200 Subject: Some logging --- otfl-font-dum.lua | 11 +++++++---- otfl-font-xtx.lua | 9 ++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua index 2cc8aeb..9b04b86 100644 --- a/otfl-font-dum.lua +++ b/otfl-font-dum.lua @@ -73,6 +73,7 @@ function fonts.names.resolve(specification) local foundname = resolvers.find_file(basename,format) or "" if foundname ~= "" then data = dofile(foundname) + logs.report("load font", "loaded font names database: %s", foundname) break end end @@ -85,24 +86,26 @@ function fonts.names.resolve(specification) if family and type(family) == "table" then for _,v in ipairs(family) do local face = data.mappings[v] - local subfamily = face.names.subfamily + local subfamily = sanitize(face.names.subfamily) local rqssize = tonumber(specification.optsize) or specification.size and specification.size / 65536 local dsnsize = face.size[1] and face.size[1] / 10 local maxsize = face.size[2] and face.size[2] / 10 local minsize = face.size[3] and face.size[3] / 10 local filename = face.filename if subfamily then - if sanitize(subfamily) == style then + if subfamily == style then if not dsnsize or dsnsize == rqssize or (rqssize > minsize and rqssize <= maxsize) then found = filename + logs.report("load font", "font family='%s', subfamily='%s' found: %s", name, style, found) break end else if synonyms[style] then for _,v in ipairs(synonyms[style]) do - if sanitize(subfamily) == v then + if subfamily == v then if not dsnsize or dsnsize == rqssize or (rqssize > minsize and rqssize <= maxsize) then found = filename + logs.report("load font", "font family='%s', subfamily='%s' found: %s", name, style, found) break end end @@ -119,7 +122,7 @@ function fonts.names.resolve(specification) end end end - logs.report("define font", "Font names database version mismatch") + logs.report("load font", "Font names database version mismatch") end fonts.names.resolvespec = fonts.names.resolve -- only supported in mkiv diff --git a/otfl-font-xtx.lua b/otfl-font-xtx.lua index d5397da..e7137c5 100644 --- a/otfl-font-xtx.lua +++ b/otfl-font-xtx.lua @@ -74,7 +74,7 @@ local function isstyle(s) elseif v:find("^s=") then list.optsize = v:split("=")[2] elseif v == "aat" or v == "icu" or v == "gr" then - logs.report("define font", "unsupported font option: %s", v) + logs.report("load font", "unsupported font option: %s", v) elseif not v:is_empty() then list.style = v:gsub("[^%a%d]", "") end @@ -143,13 +143,17 @@ local function parse_script(script) if otf.tables.scripts[script] then local dflt if otf.tables.defaults[script] then + logs.report("load font", "auto-selecting default features for script: %s", script) dflt = otf.tables.defaults[script] else + logs.report("load font", "auto-selecting default features for script: dflt (was %s)", script) dflt = otf.tables.defaults["dflt"] end for _,v in next, dflt do list[v] = "yes" end + else + logs.report("load font", "unknown script: %s", script) end end @@ -159,8 +163,7 @@ local function isname () list.lookup = 'name' end local function thename(s) list.name = s end local function issub (v) list.sub = v end local function istrue (s) list[s] = 'yes' end ---KH local function isfalse(s) list[s] = 'no' end -local function isfalse(s) list[s] = nil end -- see mpg/luaotfload#4 +local function isfalse(s) list[s] = nil end -- was no, see mpg/luaotfload#4 --KH local function iskey (k,v) if k == "script" then parse_script(v) -- cgit v1.2.3