Use font-facility to check U+25CC's availability.
[m17n/m17n-db.git] / FLT / GUR2-OTF.flt
1 ;; GUR2-OTF.flt -- Font Layout Table for gur2 OpenType fonts
2 ;; Copyright (C) 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter gur2-otf nil
6       (version "1.6.0")
7       (font (nil nil unicode-bmp :otf=gur2)))
8
9 ;;; <li> GUR2-OTF.flt
10 ;;;
11 ;;; For gur2 OpenType fonts to draw the Gurmukhi script.
12
13 (category
14  (0x0A00 0x0A7F ?X)                     ; generic
15  (0x0A00        ?Z)                     ; internal use
16  (0x0A01 0x0A02 ?a)                     ; SIGN ADAK BINDI .. BINDI
17  (0x0A03        ?A)                     ; SIGN VISARGA
18  (0x0A05 0x0A14 ?V)                     ; LETTER A .. AU
19  (0x0A15 0x0A38 ?C)                     ; LETTER KA .. SA
20  (0x0A3C        ?n)                     ; SIGN NUKTA
21  (0x0A3E        ?p)                     ; VOWEL SIGN AA
22  (0x0A3F        ?m)                     ; VOWEL SIGN I
23  (0x0A40        ?p)                     ; VOWEL SIGN II
24  (0x0A41 0x0A42 ?b)                     ; VOWEL SIGN U .. UU
25  (0x0A47 0x0A4C ?u)                     ; VOWEL SIGN EE .. AU
26  (0x0A4D        ?H)                     ; SIGN VIRAMA
27 ;; (0x0A51      ?)                      ; SIGN UDAAT
28  (0x0A59 0x0A5E ?C)                     ; LETTER KHHA .. FA
29  (0x0A70        ?a)                     ; TIPPI
30  (0x0A71        ?d)                     ; ADDAK
31 ;; (0x0A75      ?)                      ; SIGN YAKASH
32
33  (0x200C        ?N)                     ; ZWNJ
34  (0x200D        ?J)                     ; ZWJ
35  (0x25CC        ?X)                     ; DOTTED CIRCLE
36
37  (pstf          ?P)
38  )
39
40 ;; Stage 0
41 ;; Preprocessing
42 (generator
43  (0
44   (cond
45    ;; Compose a consonant and a nukta
46    ((0x0A32 0x0A3C) 0x0A33)
47    ((0x0A38 0x0A3C) 0x0A36)
48    ((0x0A16 0x0A3C) 0x0A59)
49    ((0x0A17 0x0A3C) 0x0A5A)
50    ((0x0A1C 0x0A3C) 0x0A5B)
51    ((0x0A2B 0x0A3C) 0x0A5E)
52    ("." =))
53   *))
54
55 ;; Stage 1
56 ;; Syllable identification
57 (generator
58  (0
59   (cond
60    ;; Consonant-based syllables
61    ("(Cn?J?HJ?)*Cn?(H[NJ]?|m?u?b?p?n?)a?A?"
62     < | = * | >)
63
64    ;; Syllables with an independent vowel
65    ("Vn?(J?HC)?m?u?b?p?n?a?A?"
66     < | = * | >)
67
68    ;; Combining marks are displayed with a DOTTED CIRCLE.
69    ("m"
70     (cond
71      ((font-facility 0x25CC) < = 0x25CC >)
72      ("." [ = ])))
73    ("[nHubpaA]"
74     (cond
75      ((font-facility 0x25CC) < 0x25CC = >)
76      ("." [ = ])))
77    ("JHC"
78     (cond
79      ((font-facility 0x25CC) < 0x25CC :otf=gur2=blwf,pstf+ >)
80      (".+" [ :otf=gur2=blwf,pstf+ ])))
81
82    ("." =))
83   *))
84
85 ;; Stage 2
86 ;; Basic shaping forms and matra reordering
87 (generator
88  (0
89   (cond
90    ;; Explicit halant forms
91    (" ([CnHJ]+)(HN?a?A?) "
92     (1 :otf?gur2=locl,nukt,akhn,blwf,pstf+)
93     | (1 shaping) (2 = *) |)
94
95    ;; Ordinary syllables
96    ;; 1          2    3     4     5     6
97    (" ([CnHJV]+)(mn?)?(un?)?(bn?)?(pn?)?(a?A?) "
98     (1 :otf?gur2=locl,nukt,akhn,blwf,pstf+)
99     | (2 = *) (1 shaping) (4 = *) (3 = *) (5 = *) (6 = *) |)
100
101    ("." =))
102   *)
103
104  (shaping
105   (cond
106    ("([CnHJP]*[CV]n?)((J?PP)+)$"
107     (1 :otf=gur2=locl,nukt,akhn,blwf,cjct+) (2 :otf=gur2=pstf+))
108    (".+"
109     (0 :otf=gur2=locl,nukt,akhn,blwf,cjct+))))
110  )
111
112 ;; Stage 3
113 ;; Final reordering (Move pre-base matra after the last halant)
114 (generator
115  (0
116   (cond
117    ;; 1    2         3
118    (" (mn?)([^ ]+HJ?)([^H ]+) "
119     | (2 = *) (1 = *) (3 = *) |)
120
121    ("." =))
122   *))
123
124 ;; Stage 4
125 ;; Nukta for matra and presentation forms
126 (generator
127  (0
128   (cond
129    (" ([^ ]+) "
130     | (1 :otf=gur2=nukt,pres,abvs,blws,psts,haln,calt+) |)
131
132    ("." =))
133   *))
134
135 ;; Stage 5
136 ;; Remove ZWNJ/ZWJ
137 (generator
138  (0
139   (cond
140    ("[NJ]")
141
142    ("." =))
143   *))
144
145 ;; Stage 6
146 ;; GPOS processing
147 (generator
148  (0
149   (cond
150    (" ([^ ]+) "
151     (1 :otf=gur2=+kern,dist,abvm,blwm))
152
153    ("." =))
154   *))
155
156 ;; Copyright (C) 2010
157 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
158 ;;   Registration Number H15PRO112
159
160 ;; This file is part of the m17n database; a sub-part of the m17n
161 ;; library.
162
163 ;; The m17n library is free software; you can redistribute it and/or
164 ;; modify it under the terms of the GNU Lesser General Public License
165 ;; as published by the Free Software Foundation; either version 2.1 of
166 ;; the License, or (at your option) any later version.
167
168 ;; The m17n library is distributed in the hope that it will be useful,
169 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
170 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
171 ;; Lesser General Public License for more details.
172
173 ;; You should have received a copy of the GNU Lesser General Public
174 ;; License along with the m17n library; if not, write to the Free
175 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
176 ;; Boston, MA 02110-1301, USA.
177
178 ;; Local Variables:
179 ;; mode: emacs-lisp
180 ;; End: