Handle pres, abvs, blws and psts correctly as GSUB features.
[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, 2010 AIST (H15PRO112)
3 ;; See the end for copying conditions.
4
5 (font layouter sinh-otf nil
6       (font (nil nil unicode-bmp :otf=sinh)))
7
8 ;;; <li> SINH-OTF.flt
9 ;;;
10 ;;; For Sinhala OpenType fonts to draw Sinhala.
11 ;;; A Font is available from <http://sinhala.sourceforge.net/files/>.
12
13 (category
14  (0x0D80 0x0DFF ?x)
15  (0x0D82 0x0D83 ?A)
16  (0x0D85 0x0D96 ?V)
17  (0x0D9A 0x0DC6 ?C)
18  (0x0DCA        ?H)
19  (0x0DCF 0x0DD1 ?p)
20  (0x0DD2 0x0DD3 ?u)
21  (0x0DD4 0x0DD6 ?b)
22  (0x0DD8        ?p)
23  (0x0DD9        ?m)
24  (0x0DDA        ?m)
25  (0x0DDF        ?p)
26  (0x0DF2 0x0DF3 ?p)
27  (0x200D        ?J)
28  )
29
30 ;; Stage 0
31 ;; Preprocessing
32 (generator
33  (0
34   (cond
35    ;; Decompose multi-part vowel signs.
36    ((0x0DDA)    0x0DD9 0x0DCA)
37    ((0x0DDC)    0x0DD9 0x0DCF)
38    ((0x0DDD)    0x0DD9 0x0DCF 0x0DCA)
39    ((0x0DDE)    0x0DD9 0x0DDF)
40    ("." =))
41   *))
42
43 ;; Step 1
44 ;; Syllable identification and matra reordering
45 (generator
46  (0
47   (cond
48    ;; Consonant-based syllables
49    ;;1 2      3     4
50    ("(C(HJC)*)(mm?)?(u?b?p?H?A?)"
51     < | (3 = *) (1 = *) (4 = *) | >)
52
53    ;; Syllables with an independent vowel
54    ("VA?"
55     < | = * | >)
56
57    ;; Combining marks are displayed with a DOTTED CIRCLE.
58    ((0x0DD9 0x0DCA)
59     (cond
60      ((font-facility 0x25CC) < = 0x25CC = >)
61      (".+" [ 0x0DDA ])))
62
63    ((0x0DD9 0x0DCF 0x0DCA)
64     (cond
65      ((font-facility 0x25CC) < = 0x25CC = = >)
66      (".+" [ 0x0DDD ])))
67
68    ((0x0DD9 0x0DCF)
69     (cond
70      ((font-facility 0x25CC) < = 0x25CC = >)
71      (".+" [ 0x0DDC ])))
72
73    ((0x0DD9 0x0DDF)
74     (cond
75      ((font-facility 0x25CC) < = 0x25CC = >)
76      (".+" [ 0x0DDE ])))
77
78    ("m"
79     (cond
80      ((font-facility 0x25CC) < = 0x25CC >)
81      ("." [ = ])))
82
83    ("[AHubp]"
84     (cond
85      ((font-facility 0x25CC) < 0x25CC = >)
86      ("." [ = ])))
87
88    ("." [ = ]))
89   *))
90
91 ;; Step 2 : OTF substitutions.
92 (generator
93  (0
94   (cond
95    (" ([^ ]+) "
96     (1 :otf=sinh=akhn,vatu,liga,pres,abvs,blws,psts))
97    ("." = ))
98   *))
99
100 ;; Copyright (C) 2004, 2005, 2007, 2010
101 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
102 ;;   Registration Number H15PRO112
103
104 ;; This file is part of the m17n database; a sub-part of the m17n
105 ;; library.
106
107 ;; The m17n library is free software; you can redistribute it and/or
108 ;; modify it under the terms of the GNU Lesser General Public License
109 ;; as published by the Free Software Foundation; either version 2.1 of
110 ;; the License, or (at your option) any later version.
111
112 ;; The m17n library is distributed in the hope that it will be useful,
113 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
114 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
115 ;; Lesser General Public License for more details.
116
117 ;; You should have received a copy of the GNU Lesser General Public
118 ;; License along with the m17n library; if not, write to the Free
119 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
120 ;; Boston, MA 02110-1301, USA.
121
122 ;; Local Variables:
123 ;; mode: emacs-lisp
124 ;; End: