-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
ccmp.fea
161 lines (144 loc) · 5.94 KB
/
ccmp.fea
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
lookup ccmp_cap_accents {
sub acutecomb by acute.cap;
sub gravecomb by grave.cap;
sub uni0302 by circumflex.cap;
sub uni0306 by breve.cap;
} ccmp_cap_accents;
feature ccmp {
@dotted = [i j uni0249 uni0268];
@dotless = [dotlessi uni0237 uni0249.dotless uni0268.dotless];
@accents = [gravecomb acutecomb uni0302 tildecomb uni0304 uni0306
uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D
uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni0315
uni031A uni0351 uni0357 uni0358];
@capitals = [A B C D E F G H I J K L M N O P Q R S U X Z Acircumflex AE
Ccedilla Ocircumflex Thorn Alpha Beta Gamma uni0394 Epsilon Zeta
Eta Theta Iota Kappa Lambda Mu Nu Xi Omicron Pi Rho Sigma Tau
Upsilon Phi Chi Psi uni03A9 uni0404 uni0405 uni0406 uni0408
uni0409 uni040A uni040B uni040F uni0410 uni0411 uni0412 uni0413
uni0414 uni0415 uni0416 uni0417 uni0418 uni041A uni041B uni041C
uni041D uni041E uni041F uni0420 uni0421 uni0422 uni0423 uni0424
uni0425 uni0426 uni0427 uni0428 uni0429 uni042A uni042B uni042C
uni042D uni042E uni042F];
sub @dotted' @accents by @dotless;
sub @capitals @accents' lookup ccmp_cap_accents;
} ccmp;
# Hebrew
#ifndef SANS
#ifndef MATH
#ifndef DISPLAY
@vowels = [\sheva \hatafsegol \hatafpatah \hatafqamats \hiriq \tsere \segol \patah \qamats \qubuts
\holam];
# By default the vavholam is used as vowel. This rule takes of situations where the vav is a consonant
feature ccmp { # vavholem
lookupflag RightToLeft;
sub @vowels [\vav ]' [\holam ] by \uniE801;
} ccmp;
# Several subsitutions
feature ccmp {
lookupflag RightToLeft;
sub \alef \patah by \alefpatah;
sub \alef \qamats by \alefqamats;
sub \vav \holam by \vavholam;
sub \finalkaf \sheva by \uniE802;
sub \finalkaf \qamats by \uniE803;
} ccmp;
# Rafe
feature ccmp {
lookupflag RightToLeft;
sub \bet \rafe by \betrafe;
sub \kaf \rafe by \kafrafe;
sub \pe \rafe by \perafe;
sub \gimel \rafe by \gimelrafe;
sub \dalet \rafe by \daletrafe;
sub \he \rafe by \herafe;
sub \tav \rafe by \tavrafe;
} ccmp;
# Replace glyphs with dagesh by the dagesh variants
feature ccmp {
lookupflag RightToLeft;
sub \alef \dagesh by \alefmapiq;
sub \bet \dagesh by \betdagesh;
sub \gimel \dagesh by \gimeldagesh;
sub \dalet \dagesh by \daletdagesh;
sub \he \dagesh by \hedagesh;
sub \vav \dagesh by \vavdagesh;
sub \zayin \dagesh by \zayindagesh;
sub \tet \dagesh by \tetdagesh;
sub \yod \dagesh by \yoddagesh;
sub \finalkaf \dagesh by \finalkafdagesh;
sub \kaf \dagesh by \kafdagesh;
sub \lamed \dagesh by \lameddagesh;
sub \mem \dagesh by \memdagesh;
sub \nun \dagesh by \nundagesh;
sub \samekh \dagesh by \samekhdagesh;
sub \finalpe \dagesh by \finalpedagesh;
sub \pe \dagesh by \pedagesh;
sub \tsadi \dagesh by \tsadidagesh;
sub \qof \dagesh by \qofdagesh;
sub \resh \dagesh by \reshdagesh;
sub \shin \dagesh by \shindagesh;
sub \tav \dagesh by \tavdagesh;
} ccmp;
# Take care of all shin variants
feature ccmp {
lookupflag RightToLeft;
sub \shin \shindot by \shinshindot;
sub \shin \sindot by \shinsindot;
sub \shindagesh \shindot by \shindageshshindot;
sub \shinshindot \dagesh by \shindageshshindot;
sub \shin \shindot \dagesh by \shindageshshindot;
sub \shin \dagesh \shindot by \shindageshshindot;
sub \shindagesh \sindot by \shindageshsindot;
sub \shinsindot \dagesh by \shindageshsindot;
sub \shin \sindot \dagesh by \shindageshsindot;
sub \shin \dagesh \sindot by \shindageshsindot;
} ccmp;
# The rules to take care of the furtive patah
lookup PatahToPatahGanuv {
lookupflag RightToLeft;
sub \patah by \patah.ganuv ;
} PatahToPatahGanuv;
# Replace the patah with the furtive patah
feature ccmp {
lookupflag RightToLeft;
sub [\tsere \segol \hiriq \yod \holam \vavholam \qubuts \vavdagesh ] [\he \het \ayin ] [\patah ]' lookup PatahToPatahGanuv;
sub [\dagesh \rafe ] [\tsere \segol \hiriq \holam \qubuts ] [\he \het \ayin ] [\patah ]' lookup PatahToPatahGanuv;
sub [\tsere \segol \hiriq \yod \holam \vavholam \qubuts \vavdagesh ] [\meteg ] [\he \het \ayin ] [\patah ]'lookup PatahToPatahGanuv ;
sub [\dagesh \rafe ] [\tsere \segol \hiriq \holam \qubuts ] [\meteg ] [\he \het \ayin ] [\patah ]'lookup PatahToPatahGanuv ;
} ccmp;
lookup PatahGanuvBackToPatah {
lookupflag RightToLeft;
sub \patah.ganuv by \patah ;
} PatahGanuvBackToPatah;
# Revert furtive patah in case where it is not right
feature ccmp {
lookupflag RightToLeft;
sub [\patah.ganuv ]'lookup PatahGanuvBackToPatah [\dalet \qof \resh \alef \bet \gimel \he \vav \zayin \het \tet \yod \kaf \lamed \finalmem \mem \nun \samekh \ayin \pe \finaltsadi \tsadi \shin \tav \shinshindot
\shinsindot \vavdagesh \zayindagesh \yoddagesh \nundagesh \vavholam ];
sub [\patah.ganuv ]'lookup PatahGanuvBackToPatah [\meteg ] [\dalet \qof \resh \alef
\bet \gimel \he \vav \zayin \het \tet \yod \kaf
\lamed \finalmem \mem \nun \samekh
\ayin \pe \finaltsadi \tsadi \shin \tav \shinshindot
\shinsindot \vavdagesh \zayindagesh \yoddagesh \nundagesh \vavholam ];
sub [\patah.ganuv ]'lookup PatahGanuvBackToPatah [\meteg ] [\meteg ] [\dalet \qof \resh \alef
\bet \gimel \he \vav \zayin \het \tet \yod \kaf
\lamed \finalmem \mem \nun \samekh
\ayin \pe \finaltsadi \tsadi \shin \tav \shinshindot
\shinsindot \vavdagesh \zayindagesh \yoddagesh \nundagesh \vavholam ];
} ccmp;
# hiriqmem for jerusalaim
feature ccmp {
lookupflag RightToLeft;
sub [\patah \qamats] [\hiriq]' [\finalmem ]' by \hiriqmem;
} ccmp;
# Workaround for dealing with silent alef after holam
# More elegant would be using GPOS
feature ccmp {
lookupflag RightToLeft;
ignore substitute \holam' \alef' @vowels;
sub \holam' \alef' by \holamalef;
} ccmp;
#endif
#endif
#endif