s-fonts-engines.mkiv /size: 7603 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [      file=s-fonts-engines, % was: s-fnt-22
3%D        version=2017.06.21,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Compare engines and such,
6%D         author=Hans Hagen,
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 This module is just for me when I wanted to check some husayni (by Idris)
15%D regression. Interesting is that fina should be disabled for hb (otherwise
16%D garbage) and that some substitutions are ignored in hb (1.1.3), so we can
17%D only compare some examples. Don't expect this style to be stable as I
18%D might change default features.
19
20\startmodule[fonts-engines]
21
22\usemodule[fonts-steps]
23\usemodule[fonts-plugins]
24
25\enabletrackers[fonts.reorderlookups]
26
27\startsetups otftracker-extra-context
28    \definedfont[\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}]\relax
29    \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax
30    \getvariable{otftracker}{sample}\relax
31\stopsetups
32
33\startsetups otftracker-extra-context-reordered
34    \definedfont[\getvariable{otftracker}{font}*otftracker-context-reordered at \getvariable{otftracker}{size}]\relax
35    \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax
36    \getvariable{otftracker}{sample}\relax
37\stopsetups
38
39\startsetups otftracker-extra-harfbuzz
40    \definedfont[\getvariable{otftracker}{font}*otftracker-harfbuzz-native at \getvariable{otftracker}{size}]\relax
41    \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax
42    \getvariable{otftracker}{sample}\relax
43\stopsetups
44
45\startsetups otftracker-extra-uniscribe
46    \definedfont[\getvariable{otftracker}{font}*otftracker-harfbuzz-uniscribe at \getvariable{otftracker}{size}]\relax
47    \setotfcompositiondirection{\getvariable{otftracker}{direction}}\relax
48    \getvariable{otftracker}{sample}\relax
49\stopsetups
50
51\definecolor[otftracker-overlay-1][a=1,t=.5,b=1]
52\definecolor[otftracker-overlay-2][a=1,t=.5,g=1]
53\definecolor[otftracker-overlay-3][a=1,t=.5,r=1]
54
55% This is a sort of a check against xetex but with limited font trickery because we bypass
56% the normal font handling. It's no big deal for a test. The biggest problem is that we
57% run into default features and we don't know what is turned on by default. We also need
58% to disable tagging so that hb itself can do some (init/medi/fina) magic in setting
59% features.
60
61\startsetups otftracker-extra
62    \start
63        \blank
64        \definefontfeature
65          [otftracker-context-reordered]
66          [\getvariable{otftracker}{features}]
67          [reorderlookups=arab]
68        \definefontfeature
69          [otftracker-harfbuzz-uniscribe]
70          [\getvariable{otftracker}{features}]
71          [mode=plug,
72           features=harfbuzz,
73           shaper=uniscribe,
74         % stch=nothing,
75         % ccmp=nothing,
76         % locl=nothing,
77         % rlig=nothing,
78         % calt=nothing,
79         % mset=nothing,
80           fina=nothing, % looks like the libs does something special
81           init=nothing, % looks like the libs does something special
82           medi=nothing, % looks like the libs does something special
83           isol=nothing, % looks like the libs does something special
84         % method=binary,
85           script=arabic]
86        \definefontfeature
87          [otftracker-harfbuzz-native]
88          [\getvariable{otftracker}{features}]
89          [mode=plug,
90           features=harfbuzz,
91           shaper=native,
92         % stch=nothing,
93         % ccmp=nothing,
94         % locl=nothing,
95         % rlig=nothing,
96         % calt=nothing,
97         % mset=nothing,
98           fina=nothing, % looks like the libs does something special
99           init=nothing, % looks like the libs does something special
100           medi=nothing, % looks like the libs does something special
101           isol=nothing, % looks like the libs does something special
102           script=arabic]
103        \doifelsesomething {\getvariable{otftracker}{comment}} {
104            \def\ExtraComment{
105                \TB
106                \NC
107                    comment
108                \NC
109                    \vtop {
110                        \hsize\dimexpr\hsize-10em\relax
111                        \veryraggedright
112                        \getvariable{otftracker}{comment}
113                    }
114                \NC \NR
115            }
116        } {
117            \def\ExtraComment{}
118        }
119        \starttabulate[|lTB|l|]
120            \NC
121                context
122            \NC
123                \showglyphs \showfontkerns
124                \enabletrackers[otf.sample.silent]
125                \ruledhbox{\directsetup{otftracker-extra-context}}
126                \disabletrackers[otf.sample]
127            \NC \NR \TB \NC
128                reordered
129            \NC
130                \showglyphs \showfontkerns
131                \enabletrackers[otf.sample.silent]
132                \ruledhbox{\directsetup{otftracker-extra-context-reordered}}
133                \disabletrackers[otf.sample]
134            \NC \NR \TB \NC
135                harfbuzz
136            \NC
137                \showglyphs \showfontkerns
138                \enabletrackers[fonts.plugins.hb.colors]
139                \ruledhbox{\directsetup{otftracker-extra-harfbuzz}}
140                \disabletrackers[fonts.plugins.hb.colors]
141            \NC \NR \TB \NC
142                uniscribe
143            \NC
144                \showglyphs \showfontkerns
145                \enabletrackers[fonts.plugins.hb.colors]
146                \ruledhbox{\directsetup{otftracker-extra-uniscribe}}
147                \disabletrackers[fonts.plugins.hb.colors]
148            \NC \NR \TB \NC
149                context
150            \NC
151                \showglyphs \showfontkerns
152                \ruledhbox{\directsetup{otftracker-extra-context}}
153            \NC \NR \TB \NC
154                harfbuzz
155            \NC
156                \showglyphs \showfontkerns
157                \ruledhbox{\directsetup{otftracker-extra-harfbuzz}}
158            \NC \NR \TB \NC
159                uniscribe
160            \NC
161                \showglyphs \showfontkerns
162                \ruledhbox{\directsetup{otftracker-extra-uniscribe}}
163            \NC \NR \TB \NC
164                context harfbuzz
165            \NC
166                \showglyphs \showfontkerns
167                \hbox to \zeropoint {
168                    \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-harfbuzz}}}
169                    \hss
170                }
171                \ruledhbox{\color[otftracker-overlay-3]{\directsetup{otftracker-extra-context}}}
172            \NC \NR \TB \NC
173                uniscribe harfbuzz
174            \NC
175                \showglyphs \showfontkerns
176                \hbox to \zeropoint {
177                    \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-harfbuzz}}}
178                    \hss
179                }
180                \ruledhbox{\color[otftracker-overlay-2]{\directsetup{otftracker-extra-uniscribe}}}
181            \NC \NR \TB \NC
182                context uniscribe
183            \NC
184                \showglyphs \showfontkerns
185                \hbox to \zeropoint {
186                    \ruledhbox{\color[otftracker-overlay-1]{\directsetup{otftracker-extra-uniscribe}}}
187                    \hss
188                }
189                \ruledhbox{\color[otftracker-overlay-2]{\directsetup{otftracker-extra-context}}}
190            \NC \NR
191            \ExtraComment
192        \stoptabulate
193    \stop
194\stopsetups
195
196\stopmodule
197