summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/amiri/sources/enclosing.fea
blob: 5bfa229fbcc5376f2c2dfb8465857a379dc88d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
//
// digit enclosing signs
//

// first we replace any sequence of digits (up to three places) following a
// digit enclosing sign by smaller alternates

@EndOfAyah = [uni06DD];
@NumSign   = [uni0600];
@YearSign  = [uni0601];
@FootNote  = [uni0602];
@SafhaSign = [uni0603];

@NumSignW  = [uni0600.alt];

#ifdef ITALIC
@Digits.all = [@Digits @Digits.rtl @Digits.ltr];
#else
@Digits.all = [@Digits];
#endif

lookup digit2small {
  sub @Digits by @Digits.small;
#ifdef ITALIC
  sub @Digits.rtl by @Digits.small2;
  sub @Digits.ltr by @Digits.small2;
#endif
} digit2small;

lookup NumSignW {
  sub @NumSign by @NumSignW;
} NumSignW;

feature calt {
  sub [@EndOfAyah @NumSign @SafhaSign @FootNote]                                           @Digits.all' lookup digit2small;
  sub [@EndOfAyah @NumSign @SafhaSign @FootNote] @Digits.small                             @Digits.all' lookup digit2small;
  sub [@EndOfAyah @NumSign @SafhaSign          ] @Digits.small @Digits.small               @Digits.all' lookup digit2small;
  sub @NumSign                                   @Digits.small @Digits.small @Digits.small @Digits.all' lookup digit2small;
} calt;

feature calt {
  sub @NumSign' lookup NumSignW @Digits.small @Digits.small @Digits.small @Digits.small;
} calt;

lookup digit2medium {
  sub @Digits by @Digits.medium;
#ifdef ITALIC
  sub @Digits.rtl by @Digits.medium2;
  sub @Digits.ltr by @Digits.medium2;
#endif
} digit2medium;

feature calt {
  sub @YearSign                                              @Digits.all' lookup digit2medium;
  sub @YearSign @Digits.medium                               @Digits.all' lookup digit2medium;
  sub @YearSign @Digits.medium @Digits.medium                @Digits.all' lookup digit2medium;
  sub @YearSign @Digits.medium @Digits.medium @Digits.medium @Digits.all' lookup digit2medium;
} calt;

// now we contextually kern the sign with the digits:
// * one digit: move digit's x by -(sw + dw)/2 and its Δx by -dw
// * two digits: the above, then move 1st digit's x by -dw/2 and 2nd digit's x
//   by -sw/2 and its Δx by -dw
// * three digits: the above, then move 1st & 2nd digit's x by -dw/2 and 3rd
//   digit's x by -(sw/2 - dw/2) and its Δx by -dw
//
// dw = digit width, sw = sign width

feature kern {
  pos @EndOfAyah @Digits.small'  <-1610 0 -600 0>;
  pos @NumSign   @Digits.small'  <-1622 0 -600 0>;
  pos @NumSignW  @Digits.small'  <-1922 0 -600 0>;
  pos @YearSign  @Digits.medium' <-2275 0 -900 0>;
  pos @FootNote  @Digits.small'  <-1090 0 -600 0>;
  pos @SafhaSign @Digits.small'  <-1722 0 -600 0>;
} kern;

feature kern {
  pos @EndOfAyah @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @NumSign   @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @NumSignW  @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @YearSign  @Digits.medium' <-450 0 0 0> @Digits.medium;
  pos @FootNote  @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @SafhaSign @Digits.small'  <-300 0 0 0> @Digits.small;
} kern;

feature kern {
  pos @EndOfAyah @Digits.small  @Digits.small'  <-1310 0 -600 0>;
  pos @NumSign   @Digits.small  @Digits.small'  <-1322 0 -600 0>;
  pos @NumSignW  @Digits.small  @Digits.small'  <-1622 0 -600 0>;
  pos @YearSign  @Digits.medium @Digits.medium' <-1825 0 -900 0>;
  pos @FootNote  @Digits.small  @Digits.small'  <-790  0 -600 0>;
  pos @SafhaSign @Digits.small  @Digits.small'  <-1422 0 -600 0>;
} kern;

feature kern {
  pos @EndOfAyah @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small;
  pos @NumSign   @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small;
  pos @NumSignW  @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small;
  pos @YearSign  @Digits.medium' <-450 0 0 0> @Digits.medium @Digits.medium;
  pos @SafhaSign @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small;
} kern;

feature kern {
  pos @EndOfAyah @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @NumSign   @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @NumSignW  @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small;
  pos @YearSign  @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium;
  pos @SafhaSign @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small;
} kern;

feature kern {
  pos @EndOfAyah @Digits.small  @Digits.small  @Digits.small'  <-1010 0 -600 0>;
  pos @NumSign   @Digits.small  @Digits.small  @Digits.small'  <-1022 0 -600 0>;
  pos @NumSignW  @Digits.small  @Digits.small  @Digits.small'  <-1322 0 -600 0>;
  pos @YearSign  @Digits.medium @Digits.medium @Digits.medium' <-1375 0 -900 0>;
  pos @SafhaSign @Digits.small  @Digits.small  @Digits.small'  <-1122 0 -600 0>;
} kern;

feature kern {
  pos @YearSign @Digits.medium' <-450 0 0 0> @Digits.medium @Digits.medium @Digits.medium;
  pos @NumSignW @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small  @Digits.small ;
} kern;

feature kern {
  pos @YearSign @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium @Digits.medium;
  pos @NumSignW @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small ;
} kern;

feature kern {
  pos @YearSign @Digits.medium @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium;
  pos @NumSignW @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small ;
} kern;

feature kern {
  pos @YearSign @Digits.medium @Digits.medium @Digits.medium @Digits.medium' <-925  0 -900 0>;
  pos @NumSignW @Digits.small  @Digits.small  @Digits.small  @Digits.small'  <-1022 0 -600 0>;
} kern;

/*************/
// HarfBuzz flips LTR Arabic runs before applying OpenType, but this is not what
// other engines does, so the above code does not work as it expects the digits
// and the sign in LTR order, so we do it for RTL order below until this is
// changed in HarfBuzz.
feature calt {
  sub @Digits.all' lookup digit2small                             [@EndOfAyah @NumSign @SafhaSign @FootNote];
} calt;

feature calt {
  sub @Digits.all' lookup digit2small @Digits.small               [@EndOfAyah @NumSign @SafhaSign @FootNote];
} calt;

feature calt {
  sub @Digits.all' lookup digit2small @Digits.small @Digits.small [@EndOfAyah @NumSign @SafhaSign          ];
} calt;

feature calt {
  sub @Digits.all' lookup digit2small @Digits.small @Digits.small @Digits.small @NumSign;
} calt;

feature calt {
  sub @Digits.small @Digits.small @Digits.small @Digits.small @NumSign' lookup NumSignW;
} calt;

feature calt {
  sub @Digits.all' lookup digit2medium                                              @YearSign;
} calt;

feature calt {
  sub @Digits.all' lookup digit2medium @Digits.medium                               @YearSign;
} calt;

feature calt {
  sub @Digits.all' lookup digit2medium @Digits.medium @Digits.medium                @YearSign;
} calt;

feature calt {
  sub @Digits.all' lookup digit2medium @Digits.medium @Digits.medium @Digits.medium @YearSign;
} calt;

feature kern {
  pos @Digits.small'  <-1610 0 -600 0> @EndOfAyah;
  pos @Digits.small'  <-1622 0 -600 0> @NumSign  ;
  pos @Digits.small'  <-1922 0 -600 0> @NumSignW ;
  pos @Digits.medium' <-2275 0 -900 0> @YearSign ;
  pos @Digits.small'  <-1090 0 -600 0> @FootNote ;
  pos @Digits.small'  <-1722 0 -600 0> @SafhaSign;
} kern;

feature kern {
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @EndOfAyah;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @NumSign  ;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @NumSignW ;
  pos @Digits.medium @Digits.medium' <-450 0 0 0> @YearSign ;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @FootNote ;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @SafhaSign;
} kern;

feature kern {
  pos @Digits.small'  <-1310 0 -600 0> @Digits.small  @EndOfAyah;
  pos @Digits.small'  <-1322 0 -600 0> @Digits.small  @NumSign  ;
  pos @Digits.small'  <-1622 0 -600 0> @Digits.small  @NumSignW ;
  pos @Digits.medium' <-1825 0 -900 0> @Digits.medium @YearSign ;
  pos @Digits.small'  <-790  0 -600 0> @Digits.small  @FootNote ;
  pos @Digits.small'  <-1422 0 -600 0> @Digits.small  @SafhaSign;
} kern;

feature kern {
  pos @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @EndOfAyah;
  pos @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @NumSign  ;
  pos @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @NumSignW ;
  pos @Digits.medium @Digits.medium @Digits.medium' <-450 0 0 0> @YearSign ;
  pos @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @SafhaSign;
} kern;

feature kern {
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @EndOfAyah;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @NumSign  ;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @NumSignW ;
  pos @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium @YearSign ;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @SafhaSign;
} kern;

feature kern {
  pos @Digits.small'  <-1010 0 -600 0> @Digits.small  @Digits.small  @EndOfAyah;
  pos @Digits.small'  <-1022 0 -600 0> @Digits.small  @Digits.small  @NumSign  ;
  pos @Digits.small'  <-1322 0 -600 0> @Digits.small  @Digits.small  @NumSignW ;
  pos @Digits.medium' <-1375 0 -900 0> @Digits.medium @Digits.medium @YearSign ;
  pos @Digits.small'  <-1122 0 -600 0> @Digits.small  @Digits.small  @SafhaSign;
} kern;

feature kern {
  pos @Digits.medium @Digits.medium @Digits.medium @Digits.medium' <-450 0 0 0> @YearSign;
  pos @Digits.small  @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @NumSignW;
} kern;

feature kern {
  pos @Digits.medium @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium @YearSign;
  pos @Digits.small  @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @NumSignW;
} kern;

feature kern {
  pos @Digits.medium @Digits.medium' <-450 0 0 0> @Digits.medium @Digits.medium @YearSign;
  pos @Digits.small  @Digits.small'  <-300 0 0 0> @Digits.small  @Digits.small  @NumSignW;
} kern;

feature kern {
  pos @Digits.medium' <-925  0 -900 0> @Digits.medium @Digits.medium @Digits.medium @YearSign;
  pos @Digits.small'  <-1022 0 -600 0> @Digits.small  @Digits.small  @Digits.small  @NumSignW;
} kern;
/************/