diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
commit | d7ccb42582f85acf30568913610ccf4d602023fb (patch) | |
tree | 7292e3545a420676878e7451b68892d360c62cb6 /Master/texmf-dist/tex/context/base/s-fnt-31.mkiv | |
parent | 2d62a6fe9b80def59c392268022f1f9a2d6e358f (diff) |
commit context 2011.05.18
git-svn-id: svn://tug.org/texlive/trunk@22719 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/s-fnt-31.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/s-fnt-31.mkiv | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/s-fnt-31.mkiv b/Master/texmf-dist/tex/context/base/s-fnt-31.mkiv new file mode 100644 index 00000000000..3cd689d9719 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/s-fnt-31.mkiv @@ -0,0 +1,166 @@ +%D \module +%D [ file=s-fnt-31, +%D version=2011.01.02, % about +%D title=\CONTEXT\ Style File, +%D subtitle=Comparing Fonts, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% begin info +% +% title : compare glyphs in fonts +% +% comment : show glyphs in several fonts alongside in order to to compare coverage +% status : experimental, used for luatex testing +% +% end info + +\startluacode + +local format, upper, find = string.format, string.upper, string.find +local chardata = characters.data + +function fonts.tracers.coverage(fontfiles,pattern) -- todo: patterns + + local present, names = { }, { } + local pattern = pattern and upper(pattern) + + for i=1,#fontfiles do + local fontname = format("testfont-%s",i) + local fontfile = fontfiles[i] + local fontsize = tex.dimen.bodyfontsize + local id, fontdata = fonts.definers.define { + name = fontfile, + size = fontsize, + cs = fontname, + } + for k, v in next, fontdata.characters do + present[k] = true + end + names[i] = fontname + end + + context.starttabulate {"|Tr" .. string.rep("|l",#names) .. "|" } + for i=1,#names do + context.NC() + context(i) + context.NC() + -- context.getvalue(names[i]) + context.type(fontfiles[i]) + context.NC() + context.NR() + end + context.stoptabulate() + + context.starttabulate {"|Tl" .. string.rep("|c",#names) .. "|Tl|" } + context.NC() + context.type("unicode") + context.NC() + for i=1,#names do + context.type(i) + context.NC() + end + context.type("description") + context.NC() + context.NR() + context.HL() + for k, v in table.sortedpairs(present) do + local description = chardata[k].description + if not pattern or (pattern == k) or (description and find(description,pattern)) then + context.NC() + context(format("%05X",k)) + context.NC() + for i=1,#names do + context.getvalue(names[i]) + context.char(k) + context.NC() + end + context(description) + context.NC() + context.NR() + end + end + context.stoptabulate() + +end + +\stopluacode + +\doifnotmode{demo}{\endinput} + +\setupbodyfont[10pt] + +\setuplayout + [backspace=1cm, + topspace=1cm, + footer=1cm, + header=0cm, + height=middle, + width=middle] + +\starttext + +% \startluacode +% fonts.tracers.coverage { +% "pirat.ttf", +% } +% \stopluacode + +% \startluacode +% fonts.tracers.coverage { +% -- "cambria.ttf", +% "lbr.afm", +% "LucidaBrightRegular.ttf", +% "lbi.afm", +% "LucidaBrightItalic.ttf", +% "lbd.afm", +% "LucidaBrightDemiBold.ttf", +% "lbdi.afm", +% "LucidaBrightDemiItalic.ttf", +% } +% \stopluacode + +% \startluacode +% fonts.tracers.coverage ( { +% "LucidaBrightRegular.ttf", +% "cambria.ttf", +% "iwona-regular.otf", +% "texgyrepagella-regular.otf", +% "texgyretermes-regular.otf", +% "texgyrebonum-regular.otf", +% "antpolt-regular.otf", +% }, "OGONEK") +% \stopluacode + +% \loadfontgoodies[lucida-math] +% \loadfontgoodies[lm-math] + +% \startluacode +% fonts.tracers.coverage { +% "LucidaBrightRegular.ttf", +% "LucidaBrightOne@lucida-math", +% "cambria.ttc(Cambria Math)", +% "xits-math.otf", +% "LMMath10-Regular@lmroman10-math", +% } +% \stopluacode + +\loadfontgoodies[px-math] +\loadfontgoodies[lm-math] + +\startluacode + fonts.tracers.coverage { + "cambria.ttc(Cambria Math)", + "xits-math.otf", + "LMMath10-Regular@lmroman10-math", + "pxmath@px-math", + -- "LinLibertine_Re-4.7.5.otf", + } +\stopluacode + +\stoptext |