diff options
author | Marius <mariausol@gmail.com> | 2013-05-20 03:20:28 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-05-20 03:20:28 +0300 |
commit | 5fc5cfb5014ddcc2942e13a559f4082fb66aa6e7 (patch) | |
tree | 53f81e99fac8c80ddd2fb70e233a7e5d5735722f /tex/context/base/s-fonts-missing.lua | |
parent | 13ec4b540e0d46c97fd7b089e0b7413da81e0a9f (diff) | |
download | context-5fc5cfb5014ddcc2942e13a559f4082fb66aa6e7.tar.gz |
beta 2013.05.20 02:00
Diffstat (limited to 'tex/context/base/s-fonts-missing.lua')
-rw-r--r-- | tex/context/base/s-fonts-missing.lua | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/tex/context/base/s-fonts-missing.lua b/tex/context/base/s-fonts-missing.lua index 331e73715..829fed45f 100644 --- a/tex/context/base/s-fonts-missing.lua +++ b/tex/context/base/s-fonts-missing.lua @@ -1,101 +1,101 @@ -if not modules then modules = { } end modules ['s-fonts-missing'] = {
- version = 1.001,
- comment = "companion to s-fonts-missing.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-moduledata.fonts = moduledata.fonts or { }
-moduledata.fonts.missing = moduledata.fonts.missing or { }
-
-local function legend(id)
- local c = fonts.hashes.identifiers[id]
- local privates = c.properties.privates
- if privates then
- local categories = table.swapped(fonts.loggers.category_to_placeholder)
- -- context.starttabulate { "|l|c|c|l|" }
- context.starttabulate { "|l|c|l|" }
- context.HL()
- context.NC()
- context.bold("name")
- context.NC()
- context.bold("symbol")
- context.NC()
- -- context.bold("node")
- -- context.NC()
- context.bold("category")
- context.NC()
- context.NR()
- context.HL()
- for k, v in table.sortedhash(privates) do
- local tag = characters.categorytags[categories[k]]
- if tag and tag ~= "" then
- context.NC()
- context(k)
- context.NC()
- context.dontleavehmode()
- context.char(v)
- context.NC()
- -- context.dontleavehmode()
- -- commands.getprivatechar(k)
- -- context.NC()
- context(string.lower(tag))
- context.NC()
- context.NR()
- end
- end
- context.HL()
- context.stoptabulate()
- end
-end
-
-function moduledata.fonts.missing.showlegend(specification)
- specification = interfaces.checkedspecification(specification)
- context.begingroup()
- context.definedfont { "Mono*missing" } -- otherwise no privates added
- context(function() legend(specification.id or font.current()) end)
- context.endgroup()
-end
-
-local function missings()
- local collected = fonts.checkers.getmissing()
- for filename, list in table.sortedhash(collected) do
- if #list > 0 then
- context.starttabulate { "|l|l|" }
- context.NC()
- context.bold("filename")
- context.NC()
- context(file.basename(filename))
- context.NC()
- context.NR()
- context.NC()
- context.bold("missing")
- context.NC()
- context(#list)
- context.NC()
- context.NR()
- context.stoptabulate()
- context.starttabulate { "|l|c|l|" }
- for i=1,#list do
- local u = list[i]
- context.NC()
- context("%U",u)
- context.NC()
- context.char(u)
- context.NC()
- context(characters.data[u].description)
- context.NC()
- context.NR()
- end
- context.stoptabulate()
- end
- end
-end
-
-function moduledata.fonts.missing.showcharacters(specification)
- context.begingroup()
- context.definedfont { "Mono*missing" } -- otherwise no privates added
- context(function() missings() end)
- context.endgroup()
-end
+if not modules then modules = { } end modules ['s-fonts-missing'] = { + version = 1.001, + comment = "companion to s-fonts-missing.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.fonts = moduledata.fonts or { } +moduledata.fonts.missing = moduledata.fonts.missing or { } + +local function legend(id) + local c = fonts.hashes.identifiers[id] + local privates = c.properties.privates + if privates then + local categories = table.swapped(fonts.loggers.category_to_placeholder) + -- context.starttabulate { "|l|c|c|l|" } + context.starttabulate { "|l|c|l|" } + context.HL() + context.NC() + context.bold("name") + context.NC() + context.bold("symbol") + context.NC() + -- context.bold("node") + -- context.NC() + context.bold("category") + context.NC() + context.NR() + context.HL() + for k, v in table.sortedhash(privates) do + local tag = characters.categorytags[categories[k]] + if tag and tag ~= "" then + context.NC() + context(k) + context.NC() + context.dontleavehmode() + context.char(v) + context.NC() + -- context.dontleavehmode() + -- commands.getprivatechar(k) + -- context.NC() + context(string.lower(tag)) + context.NC() + context.NR() + end + end + context.HL() + context.stoptabulate() + end +end + +function moduledata.fonts.missing.showlegend(specification) + specification = interfaces.checkedspecification(specification) + context.begingroup() + context.definedfont { "Mono*missing" } -- otherwise no privates added + context(function() legend(specification.id or font.current()) end) + context.endgroup() +end + +local function missings() + local collected = fonts.checkers.getmissing() + for filename, list in table.sortedhash(collected) do + if #list > 0 then + context.starttabulate { "|l|l|" } + context.NC() + context.bold("filename") + context.NC() + context(file.basename(filename)) + context.NC() + context.NR() + context.NC() + context.bold("missing") + context.NC() + context(#list) + context.NC() + context.NR() + context.stoptabulate() + context.starttabulate { "|l|c|l|" } + for i=1,#list do + local u = list[i] + context.NC() + context("%U",u) + context.NC() + context.char(u) + context.NC() + context(characters.data[u].description) + context.NC() + context.NR() + end + context.stoptabulate() + end + end +end + +function moduledata.fonts.missing.showcharacters(specification) + context.begingroup() + context.definedfont { "Mono*missing" } -- otherwise no privates added + context(function() missings() end) + context.endgroup() +end |