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