spac-imp-tests.mkxl /size: 7336 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [       file=spac-imp-tests,
3%D        version=2023.06.10,
4%D          title=\CONTEXT\ Spacing Macros,
5%D       subtitle=Test Passes,
6%D         author=Hans Hagen & Mikael Sundqvist,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D Eventually we will have a set of useable (realistic) presets and definitions
15%D here. So, all be low can change dependin gon what users feed back to us.
16
17% \writestatus{loading}{ConTeXt Spacing Macros / Test Passes}
18
19\unprotect
20
21\startsetups align:pass:decent
22    \pretolerance 50
23    \tolerance    150
24    \parpasses    2
25        identifier           \parpassidentifier{decent}
26        threshold            0.05pt
27        tolerance            200
28      next
29        threshold            0.05pt
30        tolerance            500
31        adjustspacing          3
32        adjustspacingstep      1
33        adjustspacingshrink   20
34        adjustspacingstretch  40
35    \relax
36%     \linebreakpasses\plusone
37\stopsetups
38
39\startsetups align:pass:quality
40    \pretolerance 50
41    \tolerance    150
42    \parpasses    4
43        identifier           \parpassidentifier{quality}
44        threshold            0.025pt
45        tolerance            175
46      next
47        threshold            0.025pt
48        tolerance            200
49      next
50        threshold            0.025pt
51        tolerance            250
52      next
53        threshold            0.025pt
54        tolerance            250
55        adjustspacing          3
56        adjustspacingstep      1
57        adjustspacingshrink   20
58        adjustspacingstretch  40
59    \relax
60%     \linebreakpasses\plusone
61\stopsetups
62
63% the test set:
64
65% \startsetups align:pass:test1
66%     \pretolerance 100
67%     \tolerance    200
68%     \parpasses      2
69%         classes              \indecentparpassclasses
70%         tolerance            400
71%       next
72%         classes              \indecentparpassclasses
73%         tolerance            400
74%         adjustspacing          3
75%         adjustspacingstep      1
76%         adjustspacingshrink   15
77%         adjustspacingstretch  30
78%         emergencystretch     .25\bodyfontsize
79%     \relax
80%     \linebreakpasses\plusone
81% \stopsetups
82
83\startsetups align:pass:test1
84    \pretolerance 100
85    \tolerance    200
86    \parpasses    1
87        classes              \almostdecentparpassclasses
88        tolerance            300
89        adjustspacing          3
90        adjustspacingstep      1
91        adjustspacingshrink   15
92        adjustspacingstretch  30
93        emergencystretch     .25\bodyfontsize
94    \relax
95%     \linebreakpasses\plusone
96\stopsetups
97
98% This one works quite well About 300 hits, almost all but a handful caught by the
99% the first one.
100
101\startsetups align:pass:test2
102    \pretolerance 100
103    \tolerance    200
104    \parpasses      3
105        classes              \indecentparpassclasses
106        threshold            0.025pt
107        tolerance            250
108        extrahyphenpenalty    50
109      next
110        threshold            0.025pt
111        tolerance            300
112        adjustspacing          3
113        adjustspacingstep      1
114        adjustspacingshrink   10
115        adjustspacingstretch  15
116      next
117        threshold            0.025pt
118        tolerance            350
119        adjustspacing          3
120        adjustspacingstep      1
121        adjustspacingshrink   20
122        adjustspacingstretch  40
123        emergencystretch     .25\bodyfontsize
124    \relax
125%     \linebreakpasses\plusone
126\stopsetups
127
128% This one works quite well. About 500 hits, all but about 10 caught by the the
129% first one
130
131\startsetups align:pass:test3
132    \pretolerance  50
133    \tolerance    100
134    \parpasses      2
135        classes              \indecentparpassclasses
136        threshold            0.025pt
137        tolerance            200
138        extrahyphenpenalty    50
139      next
140        threshold            0.025pt
141        tolerance            200
142        extrahyphenpenalty    25
143        adjustspacing          3
144        adjustspacingstep      1
145        adjustspacingshrink   20
146        adjustspacingstretch  40
147        emergencystretch     .25\bodyfontsize
148    \relax
149%     \linebreakpasses\plusone
150\stopsetups
151
152% We increase expansion stepwise Here most (about 300) end up in the fourth run,
153% only a handful in the first ones No overfull hboxes present, many large changes.
154
155\startsetups align:pass:test4
156    \pretolerance 100
157    \tolerance    200
158    \parpasses      4
159        classes              \indecentparpassclasses
160        threshold            0.025pt
161        adjustspacing         3
162        adjustspacingstep     1
163        adjustspacingshrink   5
164        adjustspacingstretch 10
165      next
166        classes              \indecentparpassclasses
167        threshold            0.025pt
168        adjustspacing         3
169        adjustspacingstep     1
170        adjustspacingshrink  10
171        adjustspacingstretch 20
172      next
173        classes              \indecentparpassclasses
174        threshold            0.025pt
175        adjustspacing         3
176        adjustspacingstep     1
177        adjustspacingshrink  20
178        adjustspacingstretch 40
179      next
180        classes              \indecentparpassclasses
181        threshold            0.025pt
182        adjustspacing         3
183        adjustspacingstep     1
184        adjustspacingshrink  40
185        adjustspacingstretch 80
186    \relax
187%     \linebreakpasses\plusone
188\stopsetups
189
190% Start with low tolerance and hopefully no hyphens. increase tolerance and
191% decrease extrahyphenpenalty Last one has a larger threshold, so only kicks in for
192% lines that stick out "much" 31-1-4-0 (but two slightly overfull hboxes)
193
194\startsetups align:pass:test5
195    \pretolerance  50
196    \tolerance    100
197    \parpasses      4
198        threshold          0.025pt
199        tolerance          200
200        extrahyphenpenalty 100
201      next
202        threshold          0.025pt
203        tolerance          400
204        extrahyphenpenalty  50
205      next
206        threshold          0.025pt
207        tolerance          500
208        extrahyphenpenalty  25
209        emergencystretch   .25\bodyfontsize
210      next
211        threshold          1pt
212        tolerance          1000
213        extrahyphenpenalty 0
214        emergencystretch   .5\bodyfontsize
215    \relax
216%     \linebreakpasses\plusone
217\stopsetups
218
219% another temporary test
220
221\permanent\protected\def\optional#1#2%
222  {\optionalboundary#1\wordboundary#2\wordboundary\optionalboundary\zerocount}
223
224\startsetups align:pass:optional1
225    \pretolerance  75
226    \tolerance    150
227    \parpasses      3
228        classes              \indecentparpassclasses
229        linebreakoptional    0
230        tolerance            150
231    next
232%         callback             \parpasscallback{experiment}
233        classes              \indecentparpassclasses
234        tolerance            200
235        linebreakoptional    0
236        emergencystretch     .25\bodyfontsize
237    next
238%         threshold            0.025pt
239        classes              \indecentparpassclasses
240        tolerance            200
241        linebreakoptional    0
242        emergencystretch     .5\bodyfontsize
243    \relax
244%     \linebreakpasses\plusone
245\stopsetups
246
247\protect \endinput
248