diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-10-18 00:46:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-10-18 00:46:16 +0200 |
commit | e2ee706a3114129601a30908d6b8cbb57068d32c (patch) | |
tree | 222b1047f4a7fe1144fefe5d0e52b78604a00f58 /tex/context/modules/mkiv/s-fonts-system.lua | |
parent | e5f189d9965a70c8f3043c07c7b07d41ef268e93 (diff) | |
download | context-e2ee706a3114129601a30908d6b8cbb57068d32c.tar.gz |
2018-10-18 00:16:00
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-system.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-system.lua | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-system.lua b/tex/context/modules/mkiv/s-fonts-system.lua index 5d2692473..dc0f2e6a3 100644 --- a/tex/context/modules/mkiv/s-fonts-system.lua +++ b/tex/context/modules/mkiv/s-fonts-system.lua @@ -114,7 +114,7 @@ end local splitter = lpeg.splitat(lpeg.S("._"),true) -local method = 3 +local method = 4 function moduledata.fonts.system.showinstalledglyphnames(specification) specification = interfaces.checkedspecification(specification) @@ -129,7 +129,8 @@ function moduledata.fonts.system.showinstalledglyphnames(specification) end end for filename in table.sortedhash(files) do - logs.report("system","fontfile: %s",file.nameonly(filename)) + local fontname = file.nameonly(filename) + logs.report("system","fontfile: %s",fontname) local data = table.load(filename) if data then if method == 1 then @@ -178,31 +179,60 @@ function moduledata.fonts.system.showinstalledglyphnames(specification) end end end + elseif method == 4 then + local descriptions = data.descriptions + if descriptions then + for u, d in sortedhash(descriptions) do + local n = d.name + local u = d.unicode + if n and not u and not find(n,"^%.") then + local n = names[n] + n[#n+1] = fontname + end + end + end else -- nothing end end end - if next(names) then - context.starttabulate { "|l|pl|" } - local f_u = formatters["%04X~(%i)"] - local f_s = formatters["%s~(%i)"] - for k, v in sortedhash(names) do - local t = { } - for k, v in sortedhash(v) do - if type(k) == "string" then - t[#t+1] = f_s(k,v) - else - t[#t+1] = f_u(k,v) + -- names[".notdef"] = nil + -- names[".null"] = nil + if method == 4 then + if next(names) then + context.starttabulate { "|l|pl|" } + local f_u = formatters["%04X~(%i)"] + local f_s = formatters["%s~(%i)"] + for k, v in sortedhash(names) do + NC() ctx_verbatim(k) + NC() context("% t",v) + NC() NR() + end + context.stoptabulate() + end + table.save("s-fonts-system-glyph-unknowns.lua",names) + else + if next(names) then + context.starttabulate { "|l|pl|" } + local f_u = formatters["%04X~(%i)"] + local f_s = formatters["%s~(%i)"] + for k, v in sortedhash(names) do + local t = { } + for k, v in sortedhash(v) do + if type(k) == "string" then + t[#t+1] = f_s(k,v) + else + t[#t+1] = f_u(k,v) + end end + NC() ctx_verbatim(k) + NC() context("%, t",t) + NC() NR() end - NC() ctx_verbatim(k) - NC() context("% t",t) - NC() NR() + context.stoptabulate() end - context.stoptabulate() + table.save("s-fonts-system-glyph-names.lua",names) end - table.save("s-fonts-system-glyph-names.lua",names) end -- -- -- |