1 ;; ORYA-OTF.flt -- Font Layout Table for Oriya OpenType font
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
9 ;; The m17n library is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU Lesser General Public License
11 ;; as published by the Free Software Foundation; either version 2.1 of
12 ;; the License, or (at your option) any later version.
14 ;; The m17n library is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; Lesser General Public License for more details.
19 ;; You should have received a copy of the GNU Lesser General Public
20 ;; License along with the m17n library; if not, write to the Free
21 ;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 ;;; For Oriya OpenType fonts to draw the Oriya script. Tested with
27 ;;; utkalm.ttf <http://oriya.sarovar.org/download/utkalm.ttf.gz>
30 ;; C: consonant (excluding Y and R)
31 ;; R: consonant RA (reph, below)
32 ;; B: consonant (below)
33 ;; Y: consonant YA, YYA (post)
40 ;; t: MATRA (two-part)
41 ;; A: vowel modifier (above)
42 ;; a: vowel modifier (post)
43 ;; V: independent vowel
44 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
45 ;; J: ZWJ (ZERO WIDTH JOINER)
50 (0x0664 0x0665 ?E) ; DANDA, DOUBLE DANDA
51 (0x0B00 0x0B7F ?E) ; ELSE
52 (0x0B01 ?A) ; SIGN CANDRABINDU (above)
53 (0x0B02 0x0B03 ?a) ; SIGN ANUSWAR, VISARGA (post)
54 (0x0B05 0x0B0C ?V) ; LETTER A .. VOCALIC L
55 (0x0B0F 0x0B10 ?V) ; LETTER E .. AI
56 (0x0B13 0x0B14 ?V) ; LETTER O .. AU
57 (0x0B15 0x0B39 ?C) ; LETTER KA .. HA
58 (0x0B24 ?B) ; LETTER TA
59 (0x0B28 ?B) ; LETTER NA
60 (0x0B2C ?B) ; LETTER BA
61 (0x0B2D ?B) ; LETTER BHA
62 (0x0B2E ?B) ; LETTER MA
63 (0x0B2F ?Y) ; LETTER YA
64 (0x0B30 ?R) ; LETTER RA
65 (0x0B32 ?B) ; LETTER LA
66 (0x0B33 ?B) ; LETTER LLA
67 (0x0B35 ?B) ; LETTER VA
68 (0x0B3C ?n) ; SIGN NUKTA
69 (0x0B3E ?p) ; VOWEL SIGN AA (post)
70 (0x0B3F ?u) ; VOWEL SIGN I (above)
71 (0x0B40 ?p) ; VOWEL SIGN II (post)
72 (0x0B41 0x0B43 ?b) ; VOWEL SIGN U, UU, R (below)
73 (0x0B47 ?m) ; VOWEL SIGN E (pre)
74 (0x0B48 0x0B4C ?t) ; VOWEL SIGN AI, O, AU (two-part)
75 (0x0B4D ?H) ; SIGN VIRAMA (HALANT)
76 (0x0B56 ?u) ; AI LENGTH MARK
77 (0x0B57 ?p) ; AU LENGTH MARK
78 (0x0B5C 0x0B5D ?C) ; LETTER RRA, RHA
79 (0x0B5F ?Y) ; LETTER YYA
80 (0x0B60 0x0B61 ?V) ; LETTER VOCALIC RR, LL
81 (0x0B71 ?C) ; LETTER WA
82 (0x0B7E ?x) ; mark #1 (internal use)
83 (0x0B7F ?y) ; mark #2 (internal use)
86 ;; Step 1 : Syllable identification. Recognised syllables are quoted
87 ;; by the pseudo character, which is generated by the command "|" and
88 ;; has the category " " (space).
92 ;; Case F : Syllables containing an independent vowel.
101 ;; Case A-C are for those syllables that end with an explicit vowel
102 ;; mark and/or a vowel modifier. They are divided into three cases
103 ;; for readability of the regular expressions. The leading
104 ;; consonant-Halant repetition is analysed for reordering in the
105 ;; next step. A two-part vowel, if any, is split for
108 ;; Case A : A syllable ending with a vowel modifier.
109 ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbup]*)(t)?([Aa])"
118 ;; Case B : A syllable ending with a two-part vowel.
119 ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))(t)"
126 ;; Case C : A syllable ending with other vowel(s). Note that a
127 ;; two-part vowel may be expressed with two vowel marks for
128 ;; backward compatibility.
129 ("(RH)?(([CRBY]n?H[NJ]?)*([CRBY]n?))([mbup]+)"
136 ;; Case E : No explicit vowel nor modifier. If the syllable ends
137 ;; with a consonant, analyse it for reordering in the next step.
138 ;; Otherwise, just identify the syllable without changing anything.
140 ("(RH)?(([CRBY]n?H[NJ]?)*[CRBY]n?)(HN|HJ|H)?"
150 ;; Set mark #1 (x) at the position where below consonants begin, and
151 ;; mark #2 (y) at the position to which below and above signs will be
157 ("([CRBY]n?(H[NJ]?Cn?)*)(H)(([RB]H)*)(Y)$"
158 (1 = *) ; prebase & base
160 (4 = *) ; below consonants
163 (3 =)) ; moved HALANT
164 ;; Ending with R or B.
166 ("([CRBY]n?(H[NJ]?Cn?)*)(H)(([RB]H)*[RB])$"
167 (1 = *) ; prebase & base
169 (4 = *) ; below consonants
175 0x0B7F))) ; below end
177 ;; Split two-part dependent vowel signs for canonicalisation.
180 ((0x0B48) 0x0B47 0x0B56)
181 ((0x0B4B) 0x0B47 0x0B3E)
182 ((0x0B4C) 0x0B47 0x0B57)))
185 ;; Step 2 : Move Reph and Matra if necessary. From now on, we care
186 ;; only for those syllables that have been identified in Step 1.
190 ;; Special case: a single consonant and a Halant.
197 ;; This is the most generic pattern. It follows Case A-C and a
198 ;; part of Case E in Step 1. Now Mark #1 is used to indicate the
199 ;; critical part that requires pre-base substitution in the
202 ;; 1 2 3 4 5 6 7 8 9 10 11
203 (" (RH)?([^ xy]+)x([^ y]*)y(YH)?(m)?(b)?(u)?(p)?(A)?(a)?(HN|HJ|H)? "
206 ;; We can safely perform Nukta composition here because it does
207 ;; not affect surrounding letters in the syllable. The Akhand
208 ;; ligature operation is also applied here, before applying the
209 ;; half form operation because the Utkal font generates Akhand
210 ;; ligatures directly from the "C H C" sequence, not via the half
212 0x0B7E ; begin Cpre & Cbase
213 (2 otf:orya=nukt,akhn+) ; {Cpre + H} + Cbase
214 0x0B7E ; end Cpre & Cbase
215 (3 otf:orya=blwf+) ; {Cbelow + H}
218 (1 otf:orya=rphf+) ; [Reph]
219 (4 otf:orya=pstf+) ; [Cpost + H]
223 (11 = *) ; optional HALANT
226 ;; Syllables that begin with an independent vowel (following up
227 ;; Step 1, Case F). Syllables of this type do not require further
239 ;; Step 3 : Now only those syllables that contain the pseudo character
240 ;; x require pre-base substition. Unlike the Mukti font for Bengali,
241 ;; the Utkal font can produce the ligature for "C1 H C2" from
242 ;; "C1halnt" and "C2". If such a ligature is not available, we get a
243 ;; sequence consisting of "C1halant" and "C2", which is satisfactory.
256 (" ([^x ]?x)([^x]*)(x[^ ]*) "
268 (1 otf:orya=haln,pres+)
272 (1 otf:orya=haln,pres+)
276 otf:orya=haln,pres+)))
280 ;; Step 4 : Mpre/Cpre reordering. If the pre-base substitution in
281 ;; the previous step results in more than one glyph, and there is an
282 ;; Mpre in this syllable, then move the Mpre before the Cbase.
283 ;; i.e. [Mpre]{Kh}Kf... -> {Kh}[Mpre]Kf...
288 (" (.)x(.+)(.)x(.*) "
295 (" (.)?x([^x ]*)x([^ ]*) "
304 ;; Step 5 : Substitutions & positioning.
310 (1 otf:orya=vatu,abvs,blws,psts))