summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/amiri/sources/kerning.fea
blob: 5d75e474acb165091b5d96d93f01d9d48097205e (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
@Dal_1 = [@aDal.fina @aDal.fina_BaaDal @aDal.fina_KafDal @aDal.fina_LamDal
          @aDal.isol];
@1st_2 = [@RaaWaw @AlefHamzaBelow];
@1st_4 = [@aHeh.isol @aHeh.fina @aHeh.fina_KafHeh @aHeh.fina_LamHeh];

// final alef with no hamza above
@Alf_1 = [uni0627.fina_LamAlfFina uni0625.fina_LamAlfFina];
@Alf_2 = [@aAlf.fina @aAlf.fina_KafAlf @aAlf.fina_KafMemAlf
          @aAlf.fina_LamAlfFina @aAlf.fina_LamAlfIsol @aAlf.fina_MemAlfFina];

@Kaf_1 = [@aKaf.init_KafHeh
          @aKaf.init_KafMemIsol];
@Kaf_2 = [@aKaf.init_KafBaaInit @aKaf.init_KafMemAlf];
@Kaf_3 = [@aKaf.init @aKaf.init_KafLam @aGaf.isol];
@Kaf_4 = [@aKaf.init_KafYaaIsol];
@Kaf_5 = [@aKaf.init_KafMemInit @aKaf.init_KafRaaIsol];
@Raa_1 = [@RaaWaw @aDal.fina @aDal.isol @aDal.fina_BaaDal @aDal.fina_KafDal
          @aDal.fina_LamDal];
@Raa_2 = [@aRaa.fina_MemRaaIsol];
@2nd_3 = [@aSen.init_SenHaaInit @aSad.init_SadHaaInit @aLam.init_LamHaaHaaInit];
@2nd_4 = [@aSad.init_AboveHaa @aSen.init_AboveHaa @aHeh.init_AboveHaa
          @aHaa.init_AboveHaa @aMem.init_AboveHaa @aKaf.init_AboveHaa
          @aAyn.init_AboveHaa];
@Teh_m = [uni0629.fina_LamHeh uni0629.fina_KafHeh // teh marbuta
          uni06C3.fina_LamHeh uni06C3.fina_KafHeh];

feature kern {
  // we don't want to kern those if there is tashkil as it touches the kaf
  pos @RaaWaw' <-600 0 -600 0>  @Kaf_1;
  pos @RaaWaw' <-300 0 -300 0>  @Kaf_4;
  pos @Dal_1'  <-600 0 -600 0>  @Kaf_1;
  pos @Dal_1'  <-400 0 -400 0>  @Kaf_4;
} kern;

lookup YaaBari3Kern {
  pos @aAyn.init <0 0 440 0>;
  pos @aFaa.init <0 0 710 0>;
  pos @aHeh.init <0 0 400 0>;
  pos @aLam.init <0 0 955 0>;
  pos @aMem.init <0 0 520 0>;
  pos @aSen.init <0 0 150 0>;
  pos @aTaa.init <0 0 150 0>;
  pos uni06BE.init <0 0 400 0>;
} YaaBari3Kern;

feature kern {
  lookupflag IgnoreMarks;
  pos @RaaWaw' <-600 0 -600 0>  @Kaf_5;
  pos @RaaWaw' <-300 0 -300 0> [@Kaf_2 @Kaf_3];

  pos @RaaWaw' <-100 0 -100 0> @2nd_3;

  pos @Dal_1'  <-600 0 -600 0>  @Kaf_5;
  pos @Dal_1'  <-400 0 -400 0> [@Kaf_2 @Kaf_3];

  pos @Raa_2' <-400 0 -400 0> [@Kaf_2 @Kaf_3 @Kaf_4];
  pos @Raa_2' <-800 0 -800 0> [@Kaf_1 @Kaf_5];
  pos @Raa_2' <-200 0 -200 0> @2nd_3;
  pos @Raa_2' <-400 0 -400 0> @2nd_4;

  // the dots of teh marbuta are very close to exclamation mark
  pos @Teh_m' < 150 0  150 0> exclam;

  // +ve kern so that the tail of raa/waw does not touch the dot of baa
  pos @1st_2' < 170 0  170 0> @aBaaDotBelow;

  // increase advance width for first glyph in 3-letter Baree Yaa ligatures
  pos [@aAyn.init @aFaa.init @aHeh.init @aLam.init
       @aMem.init @aSen.init @aTaa.init uni06BE.init]' lookup YaaBari3Kern
       @aBaa.medi_YaaBari;
} kern;

// we don't want to ignore marks here
feature kern {
  pos @Alf_1' <-500 0 -500 0> [@Kaf_1 @Kaf_5];
  pos @Alf_1' <-200 0 -200 0> @Kaf_2;
  pos @Alf_1' <-250 0 -250 0> @Kaf_3;
  pos @Alf_1' <-300 0 -300 0> @Kaf_4;

  // raa/waw/dal followed by isolated dagger alef followed by madda needs some
  // space to avoid fatha/madda clash
  pos @Raa_1' < 200 0  200 0> uni064E uni0670.isol [uni0653 uni06E4];

  pos [uni0621]' < 200 0  200 0> uni064E uni0670.isol;
} kern;

feature kern {
  lookupflag IgnoreMarks;
  pos @RaaWaw' <80 0 80 0> @aYaa.init;
} kern;

feature kern {
  lookupflag IgnoreMarks;
  // kern heh isol/final followed by kaf, does not happen in Arabic but can be
  // seen in Kurdish or Persian using ZWNJ between them.
  pos @1st_4 uni200C [@Kaf_1 @Kaf_2 @Kaf_3 @Kaf_4 @Kaf_5]' -500;
  // Uniscribe replace ZWNJ with space
  pos @1st_4 space   [@Kaf_1 @Kaf_2 @Kaf_3 @Kaf_4 @Kaf_5]' -500;
  // some applications might just remove it
  pos @1st_4         [@Kaf_1 @Kaf_2 @Kaf_3 @Kaf_4 @Kaf_5]' -500;
} kern;

// were are only interested in subset of already defined classes; the ones with
// wide dots below.
@aYaa_1 = [uni0680.init uni0776.init uni0750.init uni06CE.init uni0775.init uni06BD.init
           uni064A.init uni0755.init uni067E.init uni067B.init uni0753.init uni0752.init
           uni063D.init uni0754.init uni06D1.init uni06D0.init uni06CC.init uni0767.init
           uni0680.init_BaaRaaIsol uni0776.init_BaaRaaIsol uni0750.init_BaaRaaIsol
           uni06CE.init_BaaRaaIsol uni0775.init_BaaRaaIsol uni06BD.init_BaaRaaIsol
           uni064A.init_BaaRaaIsol uni0755.init_BaaRaaIsol uni067E.init_BaaRaaIsol
           uni067B.init_BaaRaaIsol uni0753.init_BaaRaaIsol uni0752.init_BaaRaaIsol
           uni063D.init_BaaRaaIsol uni0754.init_BaaRaaIsol uni06D1.init_BaaRaaIsol
           uni06D0.init_BaaRaaIsol uni06CC.init_BaaRaaIsol uni0767.init_BaaRaaIsol
           uni0680.init_BaaNonIsol uni0776.init_BaaNonIsol uni0750.init_BaaNonIsol
           uni06CE.init_BaaNonIsol uni0775.init_BaaNonIsol uni06BD.init_BaaNonIsol
           uni064A.init_BaaNonIsol uni0755.init_BaaNonIsol uni067E.init_BaaNonIsol
           uni067B.init_BaaNonIsol uni0753.init_BaaNonIsol uni0752.init_BaaNonIsol
           uni063D.init_BaaNonIsol uni0754.init_BaaNonIsol uni06D1.init_BaaNonIsol
           uni06D0.init_BaaNonIsol uni06CC.init_BaaNonIsol uni0767.init_BaaNonIsol
           uni0680.init_BaaYaaIsol uni0776.init_BaaYaaIsol uni0750.init_BaaYaaIsol
           uni06CE.init_BaaYaaIsol uni0775.init_BaaYaaIsol uni06BD.init_BaaYaaIsol
           uni064A.init_BaaYaaIsol uni0755.init_BaaYaaIsol uni067E.init_BaaYaaIsol
           uni067B.init_BaaYaaIsol uni0753.init_BaaYaaIsol uni0752.init_BaaYaaIsol
           uni063D.init_BaaYaaIsol uni0754.init_BaaYaaIsol uni06D1.init_BaaYaaIsol
           uni06D0.init_BaaYaaIsol uni06CC.init_BaaYaaIsol uni0767.init_BaaYaaIsol
           uni0680.init_BaaMemIsol uni0776.init_BaaMemIsol uni0750.init_BaaMemIsol
           uni06CE.init_BaaMemIsol uni0775.init_BaaMemIsol uni06BD.init_BaaMemIsol
           uni064A.init_BaaMemIsol uni0755.init_BaaMemIsol uni067E.init_BaaMemIsol
           uni067B.init_BaaMemIsol uni0753.init_BaaMemIsol uni0752.init_BaaMemIsol
           uni063D.init_BaaMemIsol uni0754.init_BaaMemIsol uni06D1.init_BaaMemIsol
           uni06D0.init_BaaMemIsol uni06CC.init_BaaMemIsol uni0767.init_BaaMemIsol
           uni0680.init_BaaSenAltInit uni0776.init_BaaSenAltInit uni0750.init_BaaSenAltInit
           uni06CE.init_BaaSenAltInit uni0775.init_BaaSenAltInit uni06BD.init_BaaSenAltInit
           uni064A.init_BaaSenAltInit uni0755.init_BaaSenAltInit uni067E.init_BaaSenAltInit
           uni067B.init_BaaSenAltInit uni0753.init_BaaSenAltInit uni0752.init_BaaSenAltInit
           uni063D.init_BaaSenAltInit uni0754.init_BaaSenAltInit uni06D1.init_BaaSenAltInit
           uni06D0.init_BaaSenAltInit uni06CC.init_BaaSenAltInit uni0767.init_BaaSenAltInit];

feature kern {
  lookupflag IgnoreMarks;
    pos @Raa_2' <180 0 180 0> @aYaa_1;
} kern;

feature kern {
  lookupflag IgnoreMarks;
#ifndef QURAN
    pos period.ara' <-300 0 -300 0> [quotedblleft quoteleft];
    pos period' -150 [quotedblright quoteright];
#else
    pos period'     <-300 0 -300 0> [quotedblleft quoteleft];
#endif
} kern;

#ifdef ITALIC
feature kern {
  lookupflag IgnoreMarks;
  pos @Alf_2 <300 0 300 0> [parenleft bracketleft braceleft];

  pos [parenright bracketright braceright] <-100 0 -100 0> [@Kaf_1 @Kaf_2 @Kaf_4 @Kaf_5];
  pos [parenright bracketright braceright] <-200 0 -200 0> [@Kaf_3];

  pos [braceright] <-200 0 -200 0> [@Kaf_1 @Kaf_2 @Kaf_4 @Kaf_5];
  pos [braceright] <-300 0 -300 0> [@Kaf_3];
} kern;
#endif

// proportional digits
feature kern {
  pos uni0661.prop uni0662.prop -100;
  pos uni0661.prop uni0663.prop -100;
  pos uni0661.prop uni0666.prop -200;
  pos uni0661.prop uni0669.prop -100;

  pos uni0662.prop uni0667.prop  100;
  pos uni0662.prop uni0668.prop  -50;

  pos uni0663.prop uni0667.prop  100;

  pos uni0664.prop uni0661.prop  -50;
  pos uni0664.prop uni0668.prop   50;

  pos uni0666.prop uni0661.prop  -50;

  pos uni0667.prop uni0661.prop  -50;
  pos uni0667.prop uni0668.prop  -50;

  pos uni0668.prop uni0661.prop -100;
  pos uni0668.prop uni0662.prop -100;
  pos uni0668.prop uni0663.prop -100;
  pos uni0668.prop uni0666.prop -100;
  pos uni0668.prop uni0667.prop -100;

  pos uni0669.prop uni0668.prop   50;
  pos uni0669.prop uni0660.prop   50;

  pos uni0660.prop uni0667.prop   50;
  pos uni0660.prop uni0668.prop   50;
} kern;

// generated features for anchor points will be inserted here by build script
{%anchors%}

// With ss05 on, kasra is below shadda, so move the shadda up a bit to
// compensate for the kasra.
feature ss05 {
  pos uni0651' <0 210 0 0> [uni0650.small];
  pos uni0651' <0 350 0 0> [uni064D.small];
} ss05;