Fix copyright years.
[m17n/m17n-db.git] / SINH-OTF.flt
1 ;; SINH-OTF.flt -- Font Layout Table for Sinhala OpenType fonts
2 ;; Copyright (C) 2004, 2005
3 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
4 ;;   Registration Number H15PRO112
5
6 ;; This file is part of the m17n database; a sub-part of the m17n
7 ;; library.
8
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.
13
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.
18
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
22 ;; 02111-1307, USA.
23
24 ;;; <li> SINH-OTF.flt
25 ;;;
26 ;;; For Sinhala OpenType fonts to draw Sinhala.
27 ;;; A Font is available from <http://sinhala.linux.lk/>.
28
29 (category
30  ;; V : independent vowels
31  ;; C : consonants
32  ;; H : AL-LAKUNA (virama)
33  ;; m : MATRA (pre)
34  ;; b : MATRA (below)
35  ;; u : MATRA (above)
36  ;; p : MATRA (post)
37  ;; t : MATRA (two-part)
38  ;; a : AVUSVARAYA & VISARGAYA
39  ;; h : Internal use
40  ;; E : else
41  ;; J : ZERO WIDTH JOINER
42  (0x0D80 0x0DFF ?E)
43  (0x0D82 0x0D83 ?a)
44  (0x0D85 0x0D96 ?V)
45  (0x0D96 0x0DC6 ?C)
46  (0x0DCA        ?H)
47  (0x0DCF 0x0DD1 ?p)
48  (0x0DD2 0x0DD3 ?u)
49  (0x0DD4 0x0DD6 ?b)
50  (0x0DD8        ?p)
51  (0x0DD9        ?m)
52  (0x0DDA        ?t)
53  (0x0DDB        ?m)
54  (0x0DDC 0x0DDE ?t)
55  (0x0DDF        ?p)
56  (0x0DF2 0x0DF3 ?p)
57  (0x0DFF        ?h)
58  (0x200D        ?J)
59  )
60
61 ;; Step 0 : Syllable identification
62 (generator
63  (0
64   (cond
65    ;; A syllable ending with a two-part vowel sign.
66    ("((CHJ)*C)(t)(a)?"
67     < | (1 otf:sinh=akhn,vatu,pres) (3 two-part) (4 =) | >)
68
69    ;; A syllable ending with a vowel sign and/or a various sign.
70    ;; Note that a two-part vowel may be expressed with two vowel marks.
71
72    ("((CHJ)*C)([mbup]+a?|a)"
73     < | (1 otf:sinh=akhn,vatu,pres) (3 = *) | >)
74
75    ;; No signs.
76    ("(CHJ)*CH?"
77     < | otf:sinh=akhn,vatu,pres | >)
78
79    ;; Independent vowels.
80    ("Va?"
81     < | = * | >)
82
83    ("." =))
84   *)
85
86  ;; Split two-part dependent vowel signs for canonicalisation.
87  (two-part
88   (cond
89    ((0x0DDA)    0x0DD9 0x0DFF)
90    ((0x0DDC)    0x0DD9 0x0DCF)
91    ((0x0DDD)    0x0DD9 0x0DCF 0x0DFF)
92    ((0x0DDE)    0x0DD9 0x0DDF)))
93  )
94
95 ;; Step 1 : Matra movements.
96 (generator
97  (0
98   (cond
99    ;; 1          2   3   4   5   6   7
100    (" ([^ mbup]+)(m)?(b)?(u)?(p)?(h)?(a)? "
101     | (2 =) (1 = *) (3 =) (4 =) (5 =) (6 0x0DCA) (7 =) |)
102    ("." =))
103   *))
104
105 ;; Step 2 : OTF substitutions.
106 (generator
107  (0
108   (cond
109    (" ([^ ]*) "
110     (1 otf:sinh))
111    ("."
112     [ otf:sinh=+ ]))
113   *))
114
115 ;; Local Variables:
116 ;; mode: emacs-lisp
117 ;; End: