context-2012-visual-debugging.tex /size: 6808 b    last modification: 2020-07-01 14:35
1\usemodule[present-stepwise,present-bars,abr-01]
2
3\startdocument
4  [title=Visual debugging,
5   color=darkmagenta]
6
7\StartSteps
8
9\startsubject[title=How it started]
10
11    \startitemize[packed]
12
13        \startitem Some 15 years ago I wanted some more feedback. \stopitem \FlushStep
14        \startitem So I figured out a way to visualize boxes, kerns, glue, etc. \stopitem \FlushStep
15        \startitem Some aspects were tricky, like stretch and shrink (no \ETEX\ yet), fillers, leaders, etc. \stopitem \FlushStep
16        \startitem I gave some presentations and it was nice to see the puzzled faces. \stopitem \FlushStep
17        \startitem As unboxing does not work, it is somewhat interfering. \stopitem \FlushStep
18        \startitem When not enabed there is no overhead but we did disable it at some places. \stopitem \FlushStep
19
20    \stopitemize
21
22\stopsubject
23
24\startsubject[title=Do we need it]
25
26    \startitemize[packed]
27
28        \startitem I wonder if anyone ever used it. \stopitem \FlushStep
29        \startitem Some of the helpers are quite handy, like \type {\ruledhbox}. \stopitem \FlushStep
30        \startitem So these had to be provided anyway, so: where to stop? \stopitem \FlushStep
31
32    \stopitemize
33
34\stopsubject
35
36\StopSteps \page \StartSteps
37
38\startsubject[title=All kind of debugging]
39
40    \startitemize[packed]
41
42        \startitem We have more debugging, much shows up when writing new code. \stopitem \FlushStep
43        \startitem Think of fonts, math, graphics, characters, etc. \stopitem \FlushStep
44        \startitem Some make no sense in \MKIV, so they're gone, but new ones show up. \stopitem \FlushStep
45        \startitem In due time this will all be normalized (as most lives in modules). \stopitem \FlushStep
46
47    \stopitemize
48
49\stopsubject
50
51\StopSteps \page \StartSteps
52
53\startsubject[title=Why we kept it]
54
55    \startitemize[packed]
56
57        \startitem When cleaning up the code I had to decide to keep it or redo it as it could be done \MKIV-ish. \stopitem \FlushStep
58        \startitem But as we already had some \LUA\ based extras it made sense to redo it. \stopitem \FlushStep
59        \startitem The old code is still there as module (also because it had some more funstuff). \stopitem \FlushStep
60
61    \stopitemize
62
63\stopsubject
64
65\startsubject[title=How it worked]
66
67    \startitemize[packed]
68
69        \startitem In \MKII\ primitives are overloaded. \stopitem \FlushStep
70        \startitem So effectively, when enabled, \type {\hbox} cum suis become macros. \stopitem \FlushStep
71        \startitem We use rules (and leaders) to visualize properties. \stopitem \FlushStep
72        \startitem Some constructs interfere so we need to compensate side effects. \stopitem \FlushStep
73
74    \stopitemize
75
76\stopsubject
77
78\StopSteps \page \StartSteps
79
80\startsubject[title=How it works]
81
82    \startitemize[packed]
83
84        \startitem The basics were a rather trivial quick job as we had a lot in place already. \stopitem \FlushStep
85        \startitem Interpreting the node list and injecting visualizers. \stopitem \FlushStep
86        \startitem We use colors, rules and text but much can be overlayed. \stopitem \FlushStep
87        \startitem Control over what gets visualized at the \TEX\ end. \stopitem \FlushStep
88        \startitem Control over what gets shown by using layers. \stopitem \FlushStep
89        \startitem As usual most time went into visualization choices and optimzation. \stopitem \FlushStep
90        \startitem Some visualizers interfered with (hardcoded) expectations in the backend. \stopitem \FlushStep
91        \startitem When I decided to use layers I had to adapt some oter code (mostly out of efficiency). \stopitem \FlushStep
92        \startitem There is room for more (but first I want the bitlib of \LUA\ 5.2). \stopitem \FlushStep
93
94    \stopitemize
95
96\stopsubject
97
98\StopSteps
99
100\page
101
102\defineoverlay[invoke][\overlaybutton{NextPage}]
103
104\defineframed
105  [MyFramed]
106  [background=color,
107   backgroundcolor=yellow,
108   offset=overlay,
109   frame=off]
110
111\startbuffer
112\ruledhbox{j}
113\ruledhbox{jj}
114\ruledhbox{jjj}
115\ruledhbox{jjjj}
116\ruledhbox{jjjjj}
117\stopbuffer
118
119\startsubject[title=Details 1]
120
121    \scale[width=\textwidth]{\MyFramed \bgroup
122         {\getbuffer}\removeunwantedspaces
123    \egroup}
124
125    \typebuffer
126
127\stopsubject
128
129\page
130
131\startbuffer
132\ruledhbox{take boxes}
133\stopbuffer
134
135\startsubject[title=Details 2a]
136
137    \scale[width=\textwidth]{\MyFramed \bgroup
138         {\getbuffer}\removeunwantedspaces
139    \egroup}
140
141    \typebuffer
142
143\stopsubject
144
145\page
146
147\startbuffer
148\ruledhbox{some depth too}
149\stopbuffer
150
151\startsubject[title=Details 2b]
152
153    \scale[width=\textwidth]{\MyFramed \bgroup
154         {\getbuffer}\removeunwantedspaces
155    \egroup}
156
157    \typebuffer
158
159\stopsubject
160
161\page
162
163\startbuffer
164\showmakeup \hbox{again an hbox}
165\stopbuffer
166
167\startsubject[title=Details 3a]
168
169    \scale[width=\textwidth]{\MyFramed \bgroup
170         {\getbuffer}\removeunwantedspaces
171    \egroup}
172
173    \typebuffer
174
175\stopsubject
176
177\page
178
179\startbuffer
180\ruledvtop{\ruledvbox{\ruledhbox{multiple boxes}}}
181\stopbuffer
182
183\startsubject[title=Details 3b]
184
185    \scale[width=\textwidth]{\MyFramed \bgroup
186         {\getbuffer}\removeunwantedspaces
187    \egroup}
188
189    \typebuffer
190
191\stopsubject
192
193\page
194
195\startbuffer
196\showmakeup \hbox{multiple boxes}
197\stopbuffer
198
199\startsubject[title=Details 3c]
200
201    \scale[width=\textwidth]{\MyFramed \bgroup
202        \hskip.5em
203         {\getbuffer}\removeunwantedspaces
204        \hskip.5em
205    \egroup}
206
207    \typebuffer
208
209\stopsubject
210
211\page
212
213\startbuffer
214\showmakeup \vbox{\hbox{multiple boxes}}
215\stopbuffer
216
217\startsubject[title=Details 3c]
218
219    \scale[width=\textwidth]{\MyFramed \bgroup
220        \hskip.5em
221         {\getbuffer}\removeunwantedspaces
222        \hskip.5em
223    \egroup}
224
225    \typebuffer
226
227\stopsubject
228
229\page
230
231\startbuffer
232\showmakeup \vtop{\vbox{\hbox{multiple boxes}}}
233\stopbuffer
234
235\startsubject[title=Details 3d]
236
237    \scale[width=\textwidth]{\MyFramed \bgroup
238        \hskip.5em
239         {\getbuffer}\removeunwantedspaces
240        \hskip.5em
241    \egroup}
242
243    \typebuffer
244
245\stopsubject
246
247\page
248
249\startbuffer
250\showstruts why \strut use \strut's
251\stopbuffer
252
253\startsubject[title=Details 4]
254
255    \scale[width=\textwidth]{\MyFramed \bgroup
256         {\getbuffer}\removeunwantedspaces
257    \egroup}
258
259    \typebuffer
260
261\stopsubject
262
263\page
264
265\startbuffer
266\showglyphs glyphs
267\stopbuffer
268
269\startsubject[title=Details 5]
270
271    \scale[width=\textwidth]{\MyFramed \bgroup
272         {\getbuffer}\removeunwantedspaces
273    \egroup}
274
275    \typebuffer
276
277\stopsubject
278\page
279
280\startbuffer
281\enabletrackers[visualizers.whatsit]glyphs \righttoleft glyphs
282\stopbuffer
283
284\startsubject[title=Details 6]
285
286    \scale[width=\textwidth]{\MyFramed \bgroup
287         \hskip.75em
288         {\getbuffer}\removeunwantedspaces
289         \hskip.75em
290    \egroup}
291
292    \typebuffer
293
294\stopsubject
295
296\stopdocument
297