diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/s-fnt-25.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/s-fnt-25.tex | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/s-fnt-25.tex b/Master/texmf-dist/tex/context/base/s-fnt-25.tex index 83a3ee58669..a8b398716c7 100644 --- a/Master/texmf-dist/tex/context/base/s-fnt-25.tex +++ b/Master/texmf-dist/tex/context/base/s-fnt-25.tex @@ -11,11 +11,15 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\def\enableshowmathfontvirtual + {\ctxlua{fonts.tfm.auto_cleanup=false}} + \def\showmathfontcharacters {\dodoubleempty\doshowmathfontcharacters} \def\doshowmathfontcharacters[#1][#2]% {\begingroup + \dontcomplain \doifelsenothing{#1} {\definedfont[MathRoman*math-text]} {\definedfont[#1]}% @@ -40,12 +44,15 @@ \blank} \def\mathfontlistentryhexdectit#1#2#3% - {#1: \ruledhbox{\char#2}\enspace#3\par + {#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}} @@ -76,6 +83,15 @@ function document.showmathfont(id,slot) local function report(...) tex.sprint(tex.ctxcatcodes,string.format(...)) end + local virtual, names = tfmdata.type == "virtual", { } + if virtual then + for k, v in ipairs(tfmdata.fonts) do + local name = fonts.ids[v.id].name + names[k] = (name and file.basename(name)) or v.id + end + end + local round = math.round +-- print(table.serialize(names)) for _, s in next, sorted do local char = characters[s] if char then @@ -83,7 +99,23 @@ function document.showmathfont(id,slot) local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants report("\\startmathfontlistentry") report("\\mathfontlistentryhexdectit{U+%05X}{%s}{%s}",s,s,string.lower(info.description or "no description, private to font")) - report("\\mathfontlistentrywdhtdpic{%s}{%s}{%s}{%s}",char.width or 0,char.height or 0,char.depth or 0,char.italic or 0) + report("\\mathfontlistentrywdhtdpic{%s}{%s}{%s}{%s}",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] = string.format("%s/%0X",names[fnt] or fnt,idx) + end + end + if #t > 0 then + report("\\mathfontlistentryresource{%s}",table.concat(t,", ")) + end + end + end if info.mathclass then report("\\mathfontlistentryclassname{%s}{%s}",info.mathclass,info.mathname or "no name") end @@ -124,7 +156,7 @@ function document.showmathfont(id,slot) if choriz_variants then local t = { } for k, v in next, choriz_variants do - t[#t+1] = string.format("\\fontlistentryvariants{%s}",v.glyph) + t[#t+1] = string.format("\\fontlistentryvariants{U+%05X}{%s}",v.glyph,v.glyph) end choriz_variants = t end @@ -147,7 +179,7 @@ end \endinput -\startbuffer mathtest +\startbuffer[mathtest] \begingroup\mm\mr\showmathfontcharacters\endgroup \stopbuffer |