*** empty log message ***
[m17n/m17n-db.git] / TAML-OTF.flt
1 ;; TAML-OTF.flt -- Font Layout Table for Tamil OpenType fonts
2 ;; Copyright (C) 2004, 2006
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> TAML-OTF.flt
25 ;;;
26 ;;; For Tamil OpenType fonts to draw Tamil.
27 ;;; Fonts are available from <http://sourceforge.net/projects/tamillinux/>.
28
29 (category
30  ;; C: general consonant
31  ;; V: independent vowel
32  ;; H: HALANT
33  ;; m: MATRA (pre)
34  ;; u: MATRA (above)
35  ;; b: MATRA (below)
36  ;; p: MATRA (post)
37  ;; A: vowel modifier (above)
38  ;; a: vowel modifier (post)
39  ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
40  ;; J: ZWJ (ZERO WIDTH JOINER)
41  ;; E: ELSE
42  ;;
43  (0x200C        ?N)                     ; ZWNJ
44  (0x200D        ?J)                     ; ZWJ
45  (0x0964        ?E)                     ; DANDA
46  (0x0965        ?E)                     ; DOUBLE DANDA
47  (0x0B80 0x0BFF ?E)                     ; ELSE
48  (0x0B85 0x0B94 ?V)                     ; LETTER AA .. LETTER AU
49  (0x0B95 0x0BB9 ?C)                     ; LETTER KA .. LETTER HA
50  (0x0BBE        ?p)                     ; VOWEL SIGN AA (post)
51  (0x0BBF        ?p)                     ; VOWEL SIGN I (post)
52  (0x0BC0        ?u)                     ; VOWEL SIGN II (above)
53  (0x0BC1        ?b)                     ; VOWEL SIGN U (below)
54  (0x0BC2        ?b)                     ; VOWEL SIGN UU (below)
55  (0x0BC6 0x0BC8 ?m)                     ; VOWEL SIGN E, EE, AI (pre)
56  (0x0BCA 0x0BCC ?t)                     ; VOWEL SIGN O, OO, AU (two-part)
57  (0x0BCD        ?H)                     ; VIRAMA
58  (0x0BD7        ?p)                     ; AU LENGTH MARK (post)
59  )
60
61 ;; Step 1 : Syllable identification.
62 (generator
63  (0
64   (cond
65    ;; Special ligature SRI
66    ((0x0BB8 0x0BCD 0x0BB0 0x0BC0)
67     otf:taml=akhn)
68
69    ;; A syllable ending with a two-part vowel sign.
70    ("((CH)*C)(t)"
71     < | (1 otf:taml=akhn) (3 two-part) | >)
72
73    ;; A syllable ending with a vowel sign.
74    ("((CH)*C)([mubp])"
75     < | (1 otf:taml=akhn) (3 =) | >)
76
77    ;; No vowel sign.
78    ("(CH)*CH?"
79     < | otf:taml=akhn | >)
80
81    ;; A variation of AU.
82    ((0x0B92 0x0BD7)
83     0x0B94)
84
85    ("." =))
86   *)
87
88  (two-part
89   (cond
90    ((0x0BCA)
91     0x0BC6 0x0BBE)
92    ((0x0BCB)
93     0x0BC7 0x0BBE)
94    ((0x0BCC)
95     0x0BC6 0x0BD7))))
96
97 ;; Step 2 : Matra movements.
98 (generator
99  (0
100   (cond
101    (" ([^ mubp]*)([^ mubp])(m)?([ubp])? "
102     | (1 = *) (3 =) (2 =) (4 =) |)
103    ("." =))
104   *))
105
106 ;; Step 3 : OTF substitutions and positionings.
107 (generator
108  (0
109   (cond
110    (" ([^ ]*) "
111     (1 otf:taml))
112    ("."
113     [ otf:taml=+ ]))
114   *))
115
116 ;; Local Variables:
117 ;; mode: emacs-lisp
118 ;; End: