1
2
3
4
5
6
7
8
9
10
11
12
13
14\unprotect
15
16\writestatus{loading}{ConTeXt Font Macros Tracing}
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35\fetchruntimecommand \showbodyfont \f!font_run
36
37
38
39
40
41
42
43
44
45\fetchruntimecommand \showfontstrip \f!font_run
46\fetchruntimecommand \testminimalbaseline \f!font_run
47\fetchruntimecommand \showminimalbaseline \f!font_run
48
49
50
51
52
53
54
55
56\fetchruntimecommand \showkerning \f!font_run
57
58
59
60
61
62
63
64
65
66
67
68
69\fetchruntimecommand \showbodyfontenvironment \f!font_run
70
71
72
73
74
75
76
77
78
79
80
81\fetchruntimecommand \showfont \f!font_run
82\fetchruntimecommand \showfontstyle \f!font_run
83\fetchruntimecommand \showligature \f!font_run
84\fetchruntimecommand \showligatures \f!font_run
85\fetchruntimecommand \showcharratio \f!font_run
86\fetchruntimecommand \showfontparameters \f!font_run
87
88\unexpanded\def\showchardata #1{\ctxcommand{showchardata("#1")}}
89\unexpanded\def\showfontdata {\ctxcommand{showfontparameters()}}
90
91
92
93
94
95
96
97
98
99\unexpanded\def\doifelsefontpresent#1{\clf_doifelsefontpresent{#1}}
100
101\let\doiffontpresentelse\doifelsefontpresent
102
103
104
105\newbox\otfcollector
106
107\unexpanded\def\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}}
108\unexpanded\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}}
109\unexpanded\def\resetotfcollecting{\ctxlua{nodes.tracers.steppers.reset()}}
110
111
112
113
114\unexpanded\def\showotfstepglyphs#1
115 {\ctxlua{nodes.tracers.steppers.glyphs(\number\otfcollector,#1)}
116 \unhbox\otfcollector}
117
118\unexpanded\def\otfstepspace
119 {\removeunwantedspaces
120 \hskip.5\emwidth \s!plus .125\emwidth \s!minus .125\emwidth\relax}
121
122\unexpanded\def\otfstepcharcommand#1#2#3
123 {\otfstepspace
124 \doif{#3}{mark}{\underbar}{U\hexnumber{#2}}:
125 \setbox\scratchbox\hbox{\ctxlua{nodes.tracers.fontchar(#1,#2)}}
126 \ifzeropt\wd\scratchbox
127 \scratchwidth.125\onepoint
128 \scratchdistance\dimexpr(\emwidth2\scratchwidth)\relax
129 \kern\scratchdistance
130 \ruledhbox to \scratchwidth{\hss\box\scratchbox\hss}
131 \kern\scratchwidth
132 \hskip\scratchdistance
133 \else
134 \ruledhbox{\box\scratchbox}
135 \fi
136 \otfstepspace}
137
138\unexpanded\def\otfstepfontcommand#1#2#3
139 {\begingroup
140 \tttf #1: #2 @ \the\dimexpr#3\scaledpoint\relax
141 \endgroup}
142
143\unexpanded\def\otfstepmessagecommand#1#2
144 {\begingroup
145 \tttf\language\minusone
146 \veryraggedright
147 \forgetparindent
148 \forgeteverypar
149 \hangindent\emwidth
150 \hangafter\plusone
151 \dontleavehmode\detokenize{#1}\removeunwantedspaces
152 \doifsomething{#2}{,\space\detokenize{#2}}\endgraf
153 \endgroup
154 \blank}
155
156\unexpanded\def\showotfstepfont
157 {\ctxlua{nodes.tracers.steppers.font("otfstepfontcommand")}}
158
159\unexpanded\def\showotfstepchars#1
160 {\ctxlua{nodes.tracers.steppers.codes(#1,"otfstepcharcommand","otfstepspace")}}
161
162\unexpanded\def\showotfstepmessages#1
163 {\ctxlua{nodes.tracers.steppers.messages(#1,"otfstepmessagecommand",true)}}
164
165\unexpanded\def\showotfstepfeatures
166 {\ctxlua{nodes.tracers.steppers.features()}}
167
168\unexpanded\def\otfnoffeaturesteps
169 {\ctxlua{nodes.tracers.steppers.nofsteps()}}
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198\newconstant\showotfstepsmode \showotfstepsmode\plusfour
199
200\unexpanded\def\showotfsteps_n
201 {\blank
202 \begingroup
203 \advance\leftskip6\emwidth
204 \showotfstepmessages\recurselevel
205 \par
206 \endgroup
207 \blank
208 \dontleavehmode
209 \hbox to \hsize \bgroup
210 \hbox to 6\emwidth \bgroup
211 \bf
212 \ifnum\recurselevel=\scratchcounter result\else step \recurselevel\fi
213 \hss
214 \egroup
215 \vtop \bgroup
216 \hsize\dimexpr\hsize6\emwidth\relax
217 \resetallattributes
218 \lefttoright
219 \dontleavehmode
220 \ifnum\recurselevel=\scratchcounter
221 \ruledhbox{\box\otfcompositionbox}
222 \else
223 \ruledhbox{\showotfstepglyphs\recurselevel}
224 \fi
225 \quad
226 \showotfstepchars\recurselevel
227 \hfill
228 \par
229 \egroup
230 \egroup
231 \blank}
232
233\unexpanded\def\showotfsteps
234 {\begingroup
235 \veryraggedright
236 \forgetparindent
237 \forgeteverypar
238 \tt
239 \lefttoright
240 \hbox to \hsize \bgroup
241 \hbox to 6\emwidth{\bf font\hss}
242 \vtop \bgroup
243 \hsize\dimexpr\hsize6\emwidth\relax
244 \language\minusone
245 \bf
246 \showotfstepfont
247 \egroup
248 \egroup
249 \blank
250 \hbox to \hsize \bgroup
251 \hbox to 6\emwidth{\bf features\hss}
252 \vtop \bgroup
253 \hsize\dimexpr\hsize6\emwidth\relax
254 \language\minusone
255 \showotfstepfeatures
256 \egroup
257 \egroup
258 \blank
259 \scratchcounter\otfnoffeaturesteps\relax
260 \dorecurse\scratchcounter
261 {\ifcase\showotfstepsmode
262 \or
263 \ifnum\recurselevel=\plusone
264 \showotfsteps_n
265 \fi
266 \or
267 \ifnum\recurselevel=\scratchcounter
268 \showotfsteps_n
269 \fi
270 \or
271 \ifnum\recurselevel=\plusone
272 \showotfsteps_n
273 \else\ifnum\recurselevel=\scratchcounter
274 \showotfsteps_n
275 \fi\fi
276 \else
277 \showotfsteps_n
278 \fi}
279 \endgroup}
280
281\unexpanded\def\startotfsample
282 {\enabletrackers[otf.sample.silent]
283 \startotfcollecting
284 \begingroup
285 \veryraggedright
286 \forgetparindent
287 \forgeteverypar}
288
289\unexpanded\def\stopotfsample
290 {\endgroup
291 \stopotfcollecting
292 \disabletrackers[otf.sample]
293 \showotfsteps
294 \resetotfcollecting}
295
296\newbox\otfcompositionbox
297
298
299
300\installcorenamespace{otfcompositiondir}
301
302\letvalue{\??otfcompositiondir 1}\righttoleft
303\letvalue{\??otfcompositiondir r2l}\righttoleft
304\letvalue{\??otfcompositiondir l2r}\lefttoright
305\letvalue{\??otfcompositiondir 1}\lefttoright
306\letvalue{\??otfcompositiondir 1}\lefttoright
307
308\unexpanded\def\setotfcompositiondirection#1
309 {\begincsname\??otfcompositiondir#1\endcsname}
310
311\unexpanded\def\showotfcomposition#1#2#3
312 {\begingroup
313 \forgetparindent
314 \forgeteverypar
315
316 \setupalign[\v!verytolerant,\v!flushleft]
317 \startotfsample
318 \nohyphens
319 \global\setbox\otfcompositionbox\hbox{\definedfont[#1]\relax\setotfcompositiondirection{#2}\relax#3}
320 \stopotfsample
321 \endgroup}
322
323
324
325
326
327
328
329
330
331\unexpanded\def\showotfcompositionlist#1#2#3
332 {\begingroup
333 \definedfont[#1]
334 \setbox\scratchbox\hbox\bgroup
335 \setotfcompositiondirection{#2}
336 #3
337 \egroup
338 \strut
339 \def##1{\kern\onepoint\string\kern\onepoint##1\kern\onepoint\string\kern\onepoint}
340 \cldcontext{nodes.listtoutf(tex.box[\number\scratchbox].list,"{\\kern\\onepoint}",true)}
341 \endgroup}
342
343\unexpanded\def\startotfcompositionlist#1#2#3\stopotfcompositionlist
344 {\begingroup
345 \unexpanded\def\showotfcompositionsample##1
346 {\NC\type{##1}
347 \NC\showotfcompositionlist{Mono}{#2}{##1}
348 \NC\showotfcompositionlist{#1}{#2}{##1}
349 \NC\definedfont[#1]##1
350 \NC\NR}
351 \starttabulate[]
352 #3
353 \stoptabulate
354 \endgroup}
355
356\let\stopotfcompositionlist\relax
357
358
359
360\unexpanded\def\savefontdata[#1]
361 {\begingroup
362 \getdummyparameters[#1]
363 \clf_savefont {
364 filename {\dummyparameter\c!file}
365 fontname {\dummyparameter\c!name}
366 method {\dummyparameter\c!method}
367 }
368 \endgroup}
369
370\protect \endinput
371 |