Include syllable final HJ to otf part.
[m17n/m17n-db.git] / FLT / SINH-OTF.flt
1 ;; SINH-OTF.flt -- Font Layout Table for Sinhala OpenType fonts
2 ;; Copyright (C) 2004, 2005, 2007  AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter sinh-otf nil
6       (font (nil nil unicode-bmp :otf=sinh=akhn)))
7
8 ;;; <li> SINH-OTF.flt
9 ;;;
10 ;;; For Sinhala OpenType fonts to draw Sinhala.
11 ;;; A Font is available from <http://sinhala.linux.lk/>.
12
13 (category
14  ;; V : independent vowels
15  ;; C : consonants
16  ;; H : AL-LAKUNA (virama)
17  ;; m : KOMBUVA
18  ;; M : DIGA KOMBUVA
19  ;; b : below-consonant vowel signs
20  ;; u : above-consonant vowel signs
21  ;; p : post-consonant vowel signs
22  ;; q : AELA-PILLA
23  ;; r : GAYANUKITTA
24  ;; s : KOMBUVA HAA AELA-PILLA
25  ;; t : two-part vowel sign
26  ;; a : AVUSVARAYA & VISARGAYA
27  ;; E : else
28  ;; J : ZERO WIDTH JOINER
29  (0x0D80 0x0DFF ?E)
30  (0x0D82 0x0D83 ?a)
31  (0x0D85 0x0D96 ?V)
32  (0x0D96 0x0DC6 ?C)
33  (0x0DCA        ?H)
34  (0x0DCF        ?q)
35  (0x0DD0 0x0DD1 ?p)
36  (0x0DD2 0x0DD3 ?u)
37  (0x0DD4 0x0DD6 ?b)
38  (0x0DD8        ?p)
39  (0x0DD9        ?m)
40  (0x0DDA        ?t)
41  (0x0DDB        ?M)
42  (0x0DDC        ?s)
43  (0x0DDD 0x0DDE ?t)
44  (0x0DDF        ?r)
45  (0x0DF2 0x0DF3 ?p)
46  (0x200D        ?J)
47  )
48
49 ;; Step 0 : Syllable identification
50 (generator
51
52  (0
53   (cond
54    ;; A syllable containing a completely decomposed two-part vowel sign.
55    ("(C(HJ[CR])*)(m(H|qH?|r)a?)"
56     < | (1 otf:sinh=akhn,vatu,pres) (3 = *) | >)
57
58    ;; A syllable containing KOMBUVA HAA AELA-PILLA.
59    ("(C(HJ[CR])*)(s)(H)?(a)?"
60     < | (1 otf:sinh=akhn,vatu,pres) (3 two-part) (4 =) (5 =) | >)
61
62    ;; A syllable with a two-part vowel sign.
63    ("(C(HJ[CR])*)(t)(a)?"
64     < | (1 otf:sinh=akhn,vatu,pres) (3 two-part) (4 =) | >)
65
66    ;; A syllable with a vowel sign and/or a various sign.
67    ("(C(HJ[CR])*)([mMbupqr]a?|a)"
68     < | (1 otf:sinh=akhn,vatu,pres) (3 = *) | >)
69
70    ;; No signs.
71    ("C(HJ[CR])*H?"
72     < | otf:sinh=akhn,vatu,pres | >)
73
74    ;; Independent vowels.
75    ("Va?"
76     < | = * | >)
77
78    ("." =))
79   *)
80
81  ;; Split two-part dependent vowel signs for canonicalisation.
82  (two-part
83   (cond
84    ((0x0DDA)    0x0DD9 0x0DCA)
85    ((0x0DDC)    0x0DD9 0x0DCF)
86    ((0x0DDD)    0x0DD9 0x0DCF 0x0DCA)
87    ((0x0DDE)    0x0DD9 0x0DDF)))
88  )
89
90 ;; Step 1 : Move pre-consonant signs.
91 (generator
92  (0
93   (cond
94    ;; 1             2     3   4   5   6   7   8   9
95    (" ([^ mMbupqr]+)(m|M)?(b)?(u)?(p)?(q)?(r)?(H)?(a)? "
96     | (2 =) (1 = *) (3 =) (4 =) (5 =) (6 =) (7 =) (8 =) (9 =) |)
97    ("." =))
98   *))
99
100 ;; Step 2 : OTF substitutions.
101 (generator
102  (0
103   (cond
104    (" ([^ ]*) "
105     (1 otf:sinh))
106    ("."
107     [ = ]))
108   *))
109
110 ;; Copyright (C) 2004, 2005, 2007
111 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
112 ;;   Registration Number H15PRO112
113
114 ;; This file is part of the m17n database; a sub-part of the m17n
115 ;; library.
116
117 ;; The m17n library is free software; you can redistribute it and/or
118 ;; modify it under the terms of the GNU Lesser General Public License
119 ;; as published by the Free Software Foundation; either version 2.1 of
120 ;; the License, or (at your option) any later version.
121
122 ;; The m17n library is distributed in the hope that it will be useful,
123 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
124 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
125 ;; Lesser General Public License for more details.
126
127 ;; You should have received a copy of the GNU Lesser General Public
128 ;; License along with the m17n library; if not, write to the Free
129 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
130 ;; Boston, MA 02110-1301, USA.
131
132 ;; Local Variables:
133 ;; mode: emacs-lisp
134 ;; End: