*** empty log message ***
[m17n/m17n-db.git] / FLT / TELU-OTF.flt
1 ;; TELU-OTF.flt -- Font Layout Table for Telugu OpenType fonts
2 ;; Copyright (C) 2004, 2007, 2008, 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter telu-otf nil
6       (version "1.6.0")
7       (font (nil nil unicode-bmp :otf=telu)))
8
9 ;;; <li> TELU-OTF.flt
10 ;;;
11 ;;; For Telugu OpenType fonts to draw the Telugu script.
12
13 (category
14  (0x0C00 0x0C7F ?X)                     ; generic
15  (0x0C01 0x0C03 ?A)                     ; SIGN CANDRABINDU .. VISARGA
16  (0x0C05 0x0C14 ?V)                     ; LETTER A .. AU
17  (0x0C15 0x0C39 ?C)                     ; LETTER KA .. HA
18  (0x0C3E 0x0C42 ?u)                     ; VOWEL SIGN AA .. II
19  (0x0C43 0x0C44 ?p)                     ; VOWEL SIGN U .. VOCALIC RR
20  (0x0C46 0x0C47 ?u)                     ; VOWEL SIGN E .. EE
21  (0x0C4A 0x0C4C ?u)                     ; VOWEL SIGN O .. AU
22  (0x0C4D        ?H)                     ; SIGN VIRAMA
23  (0x0C55        ?u)                     ; LENGTH MARK
24  (0x0C56        ?b)                     ; AI LENGTH MARK
25  (0x0C58 0x0C59 ?C)                     ; LETTER TSA .. DZA
26  (0x0C60 0x0C61 ?V)                     ; LETTER VOCALIC RR .. VOCALIC LL
27  (0x0C62 0x0C63 ?b)                     ; VOWEL SIGN VOCALIC L .. VOCALIC LL
28
29  (0x200C        ?N)                     ; ZWNJ
30  (0x200D        ?J)                     ; ZWJ
31  (0x25CC        ?X)                     ; DOTTED CIRCLE
32
33  (blwf          ?B)
34  )
35
36 ;; Stage 0
37 ;; Preprocessing
38 (generator
39  (0
40   (cond
41    ;; Decompose two-part vowel signs.
42    ((0x0C48)
43     0x0C46 0x0C56)
44
45    ("." =))
46   *))
47
48 ;; Stage 1
49 ;; Syllable identification
50 (generator
51  (0
52   (cond
53    ;; Consonant-based syllables
54    ;;1 23            4
55    ("(C((J?H|HJ?)C)*)(H[NJ]?|u?b?p?A?)"
56     < |
57     (cond
58      (".+HJ$" :otf=telu=nukt,akhn+)
59      ("(.+)(H)N?$" (1 :otf=telu=nukt,akhn+) (2 =) 0x200C)
60      (".+" :otf=telu=nukt,akhn+))
61     | >)
62
63    ;; Syllables with an independent vowel
64    ;;1  2      3
65    ("(V)(J?HC)?(u?b?p?A?)"
66     < | (1 =) (2 :otf=telu=blwf+) (3 = *) | >)
67
68    ;; Two-part vowel signs
69    ((0x0C46 0x0C56)
70     (cond
71      ((font-facility 0x25CC) < 0x25CC = = >)
72      (".+" [ 0x0C48 ])))
73
74    ;; Combining marks are displayed with a DOTTED CIRCLE.
75    ("[HubpA]"
76     (cond
77      ((font-facility 0x25CC) < 0x25CC = >)
78      ("." [ = ])))
79
80    ;; Isolated blwf is displayed with a DOTTED CIRCLE in the
81    ;; next stage.
82    ("(J)(H)(C)"
83     < | (1 =) (3 =) (2 = ) | >)
84
85    ("." =))
86   *))
87
88 ;; Stage 2
89 ;; Reorder halant for blwf
90 (generator
91  (0
92   (cond
93    ;; Isolated blwf
94    (" J(CH) "
95     (cond
96      ((font-facility 0x25CC) < 0x25CC (1 :otf=telu=blwf+) >)
97      (" J(CH) " [ (1 :otf=telu=blwf+) ])))
98
99    ;; Syllables with an overt halant
100    (" ([^ ]+)(HN) "
101     | (1 reorder *) (2 = =) |)
102
103    ;; Ordinary syllables
104    (" ([^ubpA ]+)(u?b?p?A?) "
105     | (1 reorder *) (2 = *) |)
106
107    ("." =))
108   *)
109
110  (reorder
111   (cond
112    ("J?(H)(C)"
113     (2 =) (1 =))
114    ("." =)))
115  )
116
117 ;; Stage 3
118 ;; Language forms
119 ;; Although all consonants have a blow form and none has a half form,
120 ;; we have to prevent the first consonant from forming the below form.
121 (generator
122  (0
123   (cond
124    ;; Overt halant forms
125    (" ([^ ]+)(HN) "
126     |
127     (1 (cond ("(.H)J?(.*)" (1 :otf=telu=half+) (2 lang-forms *))
128              (".+" lang-forms *)))
129     (2 = =) |)
130
131    ;; Other syllables
132    (" ([^ubpA ]*)(u?b?p?A?) "
133     |
134     (1 (cond ("(.H)J?(.*)" (1 :otf=telu=half+) (2 lang-forms *))
135              (".+" lang-forms *)))
136     (2 = *) |)
137
138    ("." =))
139   *)
140
141  (lang-forms
142   (cond
143    ("(.H)J" (1 :otf=telu=half+))
144    (".H" :otf=telu=blwf,half+)
145    ("." =)))
146  )
147
148 ;; Stage 4
149 ;; Move subscript glyphs
150 (generator
151  (0
152   (cond
153    (" ([^B ]*[^BJ])J?(B*)(ub?|b)([^ ]*) "
154     | (1 = *) (3 = *) (2 = *) (4 = *) |)
155
156    ("." =))
157   *))
158
159 ;; Stage 5
160 ;; Presentation forms
161 (generator
162  (0
163   (cond
164    (" ([^ ]+) "
165     | (1 :otf=telu=pres,abvs,blws,psts,haln+) |)
166
167    ("." =))
168   *))
169
170 ;; Stage 6
171 ;; Remove ZWNJ/ZWJ
172 (generator
173  (0
174   (cond
175    ("[NJ]")
176
177    ("." =))
178   *))
179
180 ;; Stage 7
181 ;; GPOS processing
182 (generator
183  (0
184   (cond
185    (" ([^ ]+) "
186     (1 :otf=telu=+abvm,blwm,dist))
187
188    ("." =))
189   *))
190
191 ;; Copyright (C) 2004, 2007, 2008, 2010
192 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
193 ;;   Registration Number H15PRO112
194
195 ;; This file is part of the m17n database; a sub-part of the m17n
196 ;; library.
197
198 ;; The m17n library is free software; you can redistribute it and/or
199 ;; modify it under the terms of the GNU Lesser General Public License
200 ;; as published by the Free Software Foundation; either version 2.1 of
201 ;; the License, or (at your option) any later version.
202
203 ;; The m17n library is distributed in the hope that it will be useful,
204 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
205 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
206 ;; Lesser General Public License for more details.
207
208 ;; You should have received a copy of the GNU Lesser General Public
209 ;; License along with the m17n library; if not, write to the Free
210 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
211 ;; Boston, MA 02110-1301, USA.
212
213 ;; Local Variables:
214 ;; mode: emacs-lisp
215 ;; End: