s-fonts-steps.mkiv /size: 4946 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-fonts-steps, % was s-fnt-20
3
%D version=2009.01.10,
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Tracing Feature Application (1),
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 file is used by Idris and me in the process of getting the
15
%D best arabic fonts getting rendered best. As such it might change.
16 17
\startmodule
[
fonts
-
steps
]
18 19
% \setvariables
20
% [otftracker]
21
% [title=Reverse Chaining,
22
% figure=test-003-volt.pdf,
23
% font=husayni,
24
% sample={ببب بببب ببببب بببببب}]
25 26
\def
\checkedotftrackerfeature
#
1
{
otftracker
-
\ifnum
\featureattribute
{
otftracker
-
#
1
}
=
\zerocount
default
\else
#
1
\fi
}
27
\def
\checkedotftrackerdirection
#
1
{
\csname
otftracker
-
direction
-
\ifcsname
otftracker
-
direction
-
#
1
\endcsname
#
1
\else
default
\fi\endcsname
}
28 29
% we can consider adding a dir key to features
30 31
\definefontfeature
32
[
otftracker
-
default
]
33
[
default
]
34
[
mode
=
node
]
35 36
\definefontfeature
37
[
otftracker
-
arabtype
]
38
[
mode
=
node
,
analyze
=
yes
,
39
language
=
dflt
,
script
=
arab
,
ccmp
=
yes
,
40
init
=
yes
,
medi
=
yes
,
fina
=
yes
,
isol
=
yes
,
41
liga
=
yes
,
dlig
=
yes
,
rlig
=
yes
,
clig
=
yes
,
42
mark
=
yes
,
mkmk
=
yes
,
kern
=
yes
,
curs
=
yes
]
43 44
\definefontfeature
45
[
otftracker
-
husayni
-
default
]
46
[
analyze
=
yes
,
mode
=
node
,
47
language
=
dflt
,
script
=
arab
,
48
init
=
yes
,
medi
=
yes
,
fina
=
yes
,
49
spacekern
=
yes
,
50
calt
=
yes
,
51
rlig
=
yes
,
52
ccmp
=
yes
,
53
salt
=
yes
,
54
ss
0
1
=
yes
,
% full Allah, Muhammad, Allahumma
55
ss
0
5
=
yes
,
% full Jiim stacking
56
ss
0
9
=
yes
,
% full Haa stacking
57
ss
1
0
=
yes
,
% partial dipped Miim
58
ss
1
3
=
yes
,
% full stacked Miim
59
ss
1
5
=
yes
,
% full stacked Laam-on-Miim
60
ss
1
7
=
yes
,
% full stacked Ayn-on-Miim
61
ss
1
9
=
yes
,
% LM_im
62
ss
2
4
=
yes
,
% BX specials
63
ss
2
5
=
yes
,
% LH_im specials
64
ss
2
6
=
yes
,
% full Yaa.final specials
65
ss
2
7
=
yes
,
% partial thin Miim.final
66
ss
3
1
=
yes
,
% partial Raa.final contexts
67
ss
3
4
=
yes
,
% partial Raa.final contexts
68
ss
3
5
=
yes
,
% full Kaaf contexts
69
ss
3
6
=
yes
,
% full Laam contexts
70
ss
3
7
=
yes
,
% Miim-Miim contexts
71
ss
3
8
=
yes
,
% fancy thin Haa.medial-Miim.final
72
ss
3
9
=
yes
,
% high and low Baa strings
73
ss
4
0
=
yes
,
% diagonal entry
74
ss
4
1
=
yes
,
% initial alternates
75
mark
=
yes
,
mkmk
=
yes
,
kern
=
yes
,
curs
=
yes
]
76 77
\definefontfeature
78
[
otftracker
-
husayni
]
79
[
otftracker
-
husayni
-
default
]
80 81
\definefontfeature
82
[
otftracker
-
simplenaskhi
]
83
[
analyze
=
yes
,
mode
=
node
,
84
language
=
dflt
,
script
=
arab
,
85
init
=
yes
,
medi
=
yes
,
fina
=
yes
,
calt
=
yes
,
86
rlig
=
yes
,
liga
=
yes
,
dlig
=
yes
,
87
mark
=
yes
,
mkmk
=
yes
,
kern
=
yes
,
curs
=
yes
]
88 89
\setvalue
{
otftracker
-
direction
-
arabtype
}{
r
2
l
}
90
\setvalue
{
otftracker
-
direction
-
husayni
}{
r
2
l
}
91
\setvalue
{
otftracker
-
direction
-
simplenaskhi
}{
r
2
l
}
92
\setvalue
{
otftracker
-
direction
-
default
}{}
93
\setvalue
{
otftracker
-
direction
-
sbl
-
hbrw
}{
r
2
l
}
94 95
\setvariables
96
[
otftracker
]
97
[
font
=
Serif
,
98
features
=
\checkedotftrackerfeature
{
\getvariable
{
otftracker
}{
font
}}
,
99
direction
=
\checkedotftrackerdirection
{
\getvariable
{
otftracker
}{
font
}}
,
100
size
=
4
8
pt
,
101
figure
=
,
102
title
=
Feature
Check
,
103
sample
=
no
sample
,
104
set
=
\setups
{
otftracker
}
]
105 106
\setuplayout
107
[
topspace
=
1
.
5
cm
,
108
backspace
=
1
.
5
cm
,
109
width
=
middle
,
110
height
=
middle
,
111
header
=
1
.
5
cm
,
112
footer
=
1
.
5
cm
]
113 114
\setuphead
115
[
chapter
]
116
[
header
=
high
,
117
number
=
no
]
118 119
\setupfootertexts
120
[
chapter
]
121 122
\setupalign
123
[
flushleft
]
124 125
\setupcolors
126
[
state
=
start
]
127 128
\startsetups
otftracker
-
steps
129
\doifsomething
{
\getvariable
{
otftracker
}{
figure
}}
{
130
\startlinecorrection
131
\externalfigure
[
\getvariable
{
otftracker
}{
figure
}
][
maxwidth
=
\hsize
,
frame
=
on
]
132
\stoplinecorrection
133
}
134
\showotfcomposition
135
{
\getvariable
{
otftracker
}{
font
}
*
\getvariable
{
otftracker
}{
features
}
at
\getvariable
{
otftracker
}{
size
}}
136
{
\getvariable
{
otftracker
}{
direction
}}
137
{
\getvariable
{
otftracker
}{
sample
}}
138
\stopsetups
139 140
\startsetups
otftracker
141
\setupbodyfont
[
tt
,
1
0
pt
]
142
\starttext
143
\normalexpanded
{
\startchapter
[
title
=
{
\getvariable
{
otftracker
}{
title
}}
]
}
144
\directsetup
{
otftracker
-
steps
}
145
\directsetup
{
otftracker
-
extra
}
146
\stopchapter
147
\setvariables
[
otftracker
][
comment
=]
148
\stoptext
149
\stopsetups
150 151
%D For old times sake we keep this one:
152 153
\unexpanded
\def
\ShowOtfTrackerSample
#
1
%
154
{
\doiffile
{
#
1
}
155
{
\blank
156
\startlinecorrection
157
\vbox
\bgroup
158
\forgetall
159
\setbox
\scratchbox
\hbox
{
\component
#
1
\relax
}
160
\hbox
{
\copy
\scratchbox\quad
\lower\dp
\scratchbox
\hbox
{
\ruledhbox
{
\externalfigure
[#
1
-
volt
.
pdf
][
height
=
\htdp\scratchbox
]
}}}
161
\hbox
{
\strut
\tttf
#
1
}
%
162
\egroup
163
\stoplinecorrection
164
\blank
}}
165 166
\stopmodule
167 168
\continueifinputfile
{
s
-
fonts
-
steps
.
mkiv
}
169 170
\usemodule
[
art
-
0
1
]
171 172
\setupbodyfont
173
% [cambria]
174
[
dejavu
]
175 176
\starttext
177 178
\setvariables
179
[
otftracker
]
180
[
font
=
Serif
,
181
size
=
4
8
pt
,
182
figure
=
,
183
title
=
Feature
Check
,
184
sample
=
{
affiliation
}
]
185 186
\stoptext
187