summaryrefslogtreecommitdiff
path: root/tex/context/base/s-fnt-25.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/s-fnt-25.mkiv')
-rw-r--r--tex/context/base/s-fnt-25.mkiv263
1 files changed, 0 insertions, 263 deletions
diff --git a/tex/context/base/s-fnt-25.mkiv b/tex/context/base/s-fnt-25.mkiv
deleted file mode 100644
index ae19d2434..000000000
--- a/tex/context/base/s-fnt-25.mkiv
+++ /dev/null
@@ -1,263 +0,0 @@
-%D \module
-%D [ file=s-fnt-25,
-%D version=2009.01.25,
-%D title=\CONTEXT\ Style File,
-%D subtitle=Math Glyph Checking,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\def\enableshowmathfontvirtual
- {\ctxlua{fonts.constructors.autocleanup=false}}
-
-\def\showmathfontcharacters
- {\dodoubleempty\doshowmathfontcharacters}
-
-\def\doshowmathfontcharacters[#1][#2]%
- {\begingroup
- \dontcomplain
- \doifelsenothing{#1}
- {\definedfont[MathRoman*math-text]}
- {\definedfont[#1]}%
- \doifelsenothing{#2}
- {\ctxlua{document.showmathfont(font.current())}}
- {\def\dodoshowmathfontcharacters##1{\ctxlua{document.showmathfont(font.current(),##1)}}%
- \processcommalist[#2]\dodoshowmathfontcharacters}%
- \endgroup}
-
-\def\startmathfontlist
- {\startpacked}
-
-\def\stopmathfontlist
- {\stoppacked}
-
-\def\startmathfontlistentry
- {\blank
- \begingroup}
-
-\def\stopmathfontlistentry
- {\endgroup
- \blank}
-
-\def\mathfontlistentryhexdectit#1#2#3%
- {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par
- \advance\leftskip 1em\relax}
-
-\def\mathfontlistentrywdhtdpic#1#2#3#4%
- {width: #1, height: #2, depth: #3, italic: #4\par}
-
-\def\mathfontlistentryresource#1%
- {virtual: #1\par}
-
-\def\mathfontlistentrynext#1#2%
- {#1~\ruledhbox{\char#2}}
-
-\def\mathfontlistentrynextlist#1%
- {next: #1\par}
-
-\def\fontlistentryvariants#1#2%
- {#1~\ruledhbox{\char#2}}
-
-\def\mathfontlistentryvariantslist#1%
- {variants: #1\par}
-
-\def\mathfontlistentrynextvariantslist#1#2%
- {next: #1 => variants: #2\par}
-
-\def\mathfontlistentryclassname#1#2%
- {mathclass: #1, mathname: #2\par}
-
-\def\mathfontlistentrysymbol#1#2%
- {mathsymbol: #1~\ruledhbox{\char#2}\par}
-
-\def\startmathfontlookupvariants
- {lookupvariants: }
-
-\def\stopmathfontlookupvariants
- {\par}
-
-\def\mathfontlookupvariant#1#2%
- {#1:~\char#2}
-
-\startluacode
-local concat = table.concat
-local format, lower = string.format, string.lower
-local utfchar = utf.char
-
-local fontdata = fonts.hashes.identifiers
-
-function document.showmathfont(id,slot)
- local data = characters.data
- local tfmdata = fontdata[id]
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local resources = tfmdata.resources
- local lookuptypes = resources.lookuptypes
- local sorted = (slot and { slot }) or table.sortedkeys(characters)
- local virtual, names = tfmdata.properties.virtualized, { }
- if virtual then
- for k, v in ipairs(tfmdata.fonts) do
- local id = v.id
- local name = fontdata[id].properties.name
- names[k] = (name and file.basename(name)) or id
- end
- end
- local round = math.round
- local limited = true
- for _, s in next, sorted do
- if not limited or s < 0xF0000 then
- local char = characters[s]
- local desc = descriptions[s]
- if char then
- local info = data[s]
- local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants
- context.startmathfontlistentry()
- context.mathfontlistentryhexdectit(format("U+%05X",s),s,lower(info.description or "no description, private to font"))
- context.mathfontlistentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0))
- if virtual then
- local commands = char.commands
- if commands then
- local t = { }
- for i=1,#commands do
- local ci = commands[i]
- if ci[1] == "slot" then
- local fnt, idx = ci[2], ci[3]
- t[#t+1] = format("%s/%0X",names[fnt] or fnt,idx)
- end
- end
- if #t > 0 then
- context.mathfontlistentryresource(concat(t,", "))
- end
- end
- end
- if info.mathclass then
- context.mathfontlistentryclassname(info.mathclass,info.mathname or "no name")
- end
- if info.mathspec then
- for i=1,#info.mathspec do
- context.mathfontlistentryclassname(info.mathspec[i].class,info.mathspec[i].name or "no name")
- end
- end
- if info.mathsymbol then
- context.mathfontlistentrysymbol(format("U+%05X",info.mathsymbol),info.mathsymbol)
- end
- if cnext then
- local t, done = { }, { }
- while cnext do
- if done[cnext] then
- t[#t+1] = "CYCLE"
- break
- else
- done[cnext] = true
- t[#t+1] = context.nested.mathfontlistentrynext(format("U+%05X",cnext),cnext)
- cnext = characters[cnext]
- cvert_variants = cnext.vert_variants or cvert_variants
- choriz_variants = cnext.horiz_variants or choriz_variants
- if cnext then
- cnext = cnext.next
- end
- end
- end
- cnext = t
- end
- if cvert_variants then
- local t = { }
- for k, v in next, cvert_variants do
- t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph)
- end
- cvert_variants = t
- end
- if choriz_variants then
- local t = { }
- for k, v in next, choriz_variants do
- t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph)
- end
- choriz_variants = t
- end
- local cvariants = choriz_variants or cvert_variants
- if cvariants and cnext then
- context.mathfontlistentrynextvariantslist(concat(cnext," => "),concat(cvariants," => "))
- else
- if cnext then
- context.mathfontlistentrynextlist(concat(cnext," => "))
- end
- if cvariants then
- context.mathfontlistentryvariantslist(concat(cvariants," "))
- end
- end
- local slookups = desc.slookups
- local mlookups = desc.mlookups
- if slookups or mlookups then
- local variants = { }
- if slookups then
- for lookupname, lookupdata in next, slookups do
- local lookuptype = lookuptypes[lookupname]
- if lookuptype == "substitution" then
- variants[lookupdata] = true
- elseif lookuptype == "alternate" then
- for i=1,#lookupdata do
- variants[lookupdata[i]] = true
- end
- end
- end
- end
- if mlookups then
- for lookupname, lookuplist in next, mlookups do
- local lookuptype = lookuptypes[lookupname]
- for i=1,#lookuplist do
- local lookupdata = lookuplist[i]
- local lookuptype = lookuptypes[lookupname]
- if lookuptype == "substitution" then
- variants[lookupdata] = true
- elseif lookuptype == "alternate" then
- for i=1,#lookupdata do
- variants[lookupdata[i]] = true
- end
- end
- end
- end
- end
- variants = table.sortedkeys(variants)
- context.startmathfontlookupvariants()
- for i=1,#variants do
- local variant = variants[i]
- context.mathfontlookupvariant(format("U+%05X",variant),variant)
- end
- context.stopmathfontlookupvariants()
- end
- context.stopmathfontlistentry()
- end
- end
- end
-end
-\stopluacode
-
-\continueifinputfile{s-fnt-25.mkiv} % \doifnotmode{demo}\endinput
-
-\setuplayout
- [width=middle,
- height=middle,
- topspace=15mm,
- backspace=15mm,
- bottomspace=15mm,
- header=1cm,
- headerdistance=0.5cm,
- footer=0pt]
-
-\starttext
-% \setupbodyfont[cambria, 12pt] \showmathfontcharacters
-% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters
-% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters
-% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters
-% \setupbodyfont[palatino, 10pt] \showmathfontcharacters
-% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters
-% \setupbodyfont[stix, 12pt] \showmathfontcharacters
- \setupbodyfont[xits, 12pt] \showmathfontcharacters
-% \setupbodyfont[lucida, 12pt] \showmathfontcharacters
-% \setupbodyfont[lucida-nova, 12pt] \showmathfontcharacters
-\stoptext
-