1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\startluacode
17 moduledata.fonts = moduledata.fonts or { }
18 moduledata.fonts.complete = moduledata.fonts.complete or { }
19
20 local fontdata = fonts.hashes.identifiers
21
22 local context = context
23 local escaped = context.escaped
24
25 function moduledata.fonts.complete.all()
26 local tfmdata = fontdata[true]
27 if tfmdata then
28 local NC, NR, HL, char, bold, tttf = context.NC, context.NR, context.HL, context.char, context.bold, context.tttf
29 local descriptions = tfmdata.descriptions or { }
30 local data = characters.data
31
32
33
34
35
36
37
38
39
40
41
42
43 context.starttabulate { "|l|c|p(8em)|l|l|p|p|p|" }
44 NC() bold("unicode")
45 NC() bold("visual")
46 NC() bold("unicodes")
47 NC() bold("tounicode")
48 NC() bold("index")
49 NC() bold("glyph")
50 NC() bold("adobe")
51 NC() bold("context")
52 NC() NR()
53 for unicode, chr in fonts.iterators.characters(tfmdata) do
54 local des, dat = descriptions[unicode], data[unicode]
55 local index = chr.index or 0
56 local tounicode = chr.tounicode
57 local isunicode = chr.unicode
58 local cname = (dat and dat.contextname) or ""
59 local aname = (dat and dat.adobename) or ""
60 local gname = (des and des.name) or ""
61 local mname = dat and dat.mathname
62 if type(mname) ~= "string" then
63 mname = ""
64 end
65 local mspec = dat and dat.mathspec
66 if mspec then
67 for m=1,#mspec do
68 local n = mspec[m].name
69 if n then
70 if mname == "" then
71 mname = n
72 else
73 mname = mname .. " " .. n
74 end
75 end
76 end
77 end
78 if mname ~= "" then
79 mname = "m: " .. mname
80 if cname ~= "" then
81 cname = cname .. " " .. mname
82 else
83 cname = mname
84 end
85 end
86 NC()
87 tttf()
88 context("%05X",unicode)
89 NC()
90 char(unicode)
91 NC()
92 if isunicode then
93 tttf()
94 if type(isunicode) == "table" then
95 for i=1,#isunicode do
96 if i > 1 then
97 if i % 2 ~= 0 then
98 context.crlf()
99 else
100 context.space()
101 end
102 end
103 context("%05X",isunicode[i])
104 end
105 else
106 context("%05X",isunicode)
107 end
108 end
109 NC()
110 if tounicode then
111 tttf()
112 context(tounicode)
113 end
114 NC()
115 tttf()
116 context("%05X",index)
117 NC()
118 if gname ~= "" then
119 tttf()
120 escaped(gname)
121 end
122 NC()
123 if aname ~= "" then
124 tttf()
125 context(aname)
126 end
127 NC()
128 if cname ~= "" then
129 tttf()
130 context(cname)
131 end
132 NC() NR()
133 end
134 context.stoptabulate()
135 else
136 context("problems")
137 end
138 end
139
140 function moduledata.fonts.complete.glyphs()
141 local tfmdata = fontdata[true]
142 if tfmdata then
143 for unicode, chr in fonts.iterators.characters(tfmdata) do
144 context.showglyph(unicode)
145 end
146 end
147 end
148\stopluacode
149
150\unexpanded\def\ShowCompleteFont#1#2#3
151 {\begingroup
152 \page
153 \font\TestFont=#1 at #2
154 \setuplayout[style=\TestFont]
155 \setupheadertexts[]
156 \setupfootertexts[#1\space\endash\space\pagenumber]
157 \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm]
158 \TestFont
159 \nonknuthmode
160 \startcolumns[n=#3]
161 \TestFont
162 \ctxlua { moduledata.fonts.complete.all() }
163 \stopcolumns
164 \page
165 \endgroup}
166
167\unexpanded\def\ShowAllGlyphs#1#2#3
168 {\begingroup
169 \page
170 \def\showglyph##1{\dontleavehmode\strut\char##1\relax\par}
171 \font\TestFontA=#1 at 12pt
172 \font\TestFontB=#1 at #2
173 \setuplayout[style=\TestFontA]
174 \setupheadertexts[]
175 \setupfootertexts[#1\space\endash\space\pagenumber]
176 \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm,header=1cm,footer=2cm]
177 \TestFontB \setupinterlinespace[line=1.2\dimexpr#2\relax] \raggedcenter
178 \nonknuthmode
179 \startcolumns[n=#3]
180 \TestFontB
181 \ctxlua { moduledata.fonts.complete.glyphs() }
182 \stopcolumns
183 \page
184 \endgroup}
185
186\continueifinputfile{sfontscomplete.mkiv}
187
188\usemodule[art01] \setuplayout[overview] \setupbodyfont[8pt]
189
190\starttext
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214\setuplayout[overview][footer=1cm] \setuplayout[overview]
215
216\ShowCompleteFont{file:aegean} {8pt}{1}
217
218
219
220
221
222
223\stoptext
224 |