*** empty log message ***
[m17n/m17n-db.git] / FLT / TAML-OTF.flt
1 ;; TAML-OTF.flt -- Font Layout Table for Tamil OpenType fonts
2 ;; Copyright (C) 2004, 2006, 2007
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., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
23
24 ;;; <li> TAML-OTF.flt
25 ;;;
26 ;;; For Tamil OpenType fonts to draw the Tamil script.
27
28 (font layouter taml-otf nil
29       (font (nil nil unicode-bmp :otf=taml=akhn)))
30
31 (category
32  ;; C: consonant
33  ;; H: HALANT
34  ;; m: vowel sign (pre)
35  ;; u: vowel sign (above)
36  ;; b: vowel sign (below)
37  ;; p: vowel sign (post)
38  ;; X: generic
39  (0x0B80 0x0BFF ?X)                     ; generic
40  (0x0B95 0x0BB9 ?C)                     ; LETTER KA .. HA
41  (0x0BBE 0x0BBF ?p)                     ; VOWEL SIGN AA .. I
42  (0x0BC0        ?u)                     ; VOWEL SIGN II
43  (0x0BC1 0x0BC2 ?b)                     ; VOWEL SIGN U .. UU
44  (0x0BC6 0x0BC8 ?m)                     ; VOWEL SIGN E .. AI
45  (0x0BCD        ?H)                     ; SIGN VIRAMA
46  (0x0BD7        ?p)                     ; AU LENGTH MARK
47  (0x0964 0x0965 ?X)                     ; DANDA .. DOUBLE DANDA
48  (0x200C        ?N)                     ; ZWNJ
49  )
50
51 ;; Preprocessing.
52 (generator
53  (0
54   (cond
55    ;; Decompose two-part vowel signs.
56    ((0x0BCA)
57     0x0BC6 0x0BBE)
58    ((0x0BCB)
59     0x0BC7 0x0BBE)
60    ((0x0BCC)
61     0x0BC6 0x0BD7)
62    ;; A variation of AU.
63    ((0x0B92 0x0BD7)
64     0x0B94)
65    ;; TAMu and TSCu fonts generate the SRI ligature with 'akhn'.
66    ;; (lohit and latha do it with 'half' + 'abvs'.)
67    ((0x0BB8 0x0BCD 0x0BB0 0x0BC0)
68     otf:taml=akhn+)
69    ("." =))
70   *))
71
72 ;; Syllable identification.
73 (generator
74  (0
75   (cond
76    ;; A syllable with vowel signs.
77    ("((CH)*C)(m|b|u|p|mp)"
78     < | (1 otf:taml=akhn,half+) (3 = *) | >)
79
80    ;; No vowel signs.
81    ("((CH)*C)(HN|H)?"
82     < | (1 otf:taml=akhn,half+) (3 =) | >)
83
84    ("." =))
85   *))
86
87 ;; Move Matra before the base consonant.
88 (generator
89  (0
90   (cond
91    (" ([^ m]*)([^ m])(m)(p)? "
92     | (1 = *) (3 =) (2 =) (4 =) |)
93    ("." =))
94   *))
95
96 ;; Apply other OTF features.
97 (generator
98  (0
99   (cond
100    (" ([^ ]+) "
101     (1 otf:taml=pres,abvs,blws,psts,haln+abvm,blwm,dist))
102    ("."
103     [ = ]))
104   *))
105
106 ;; Local Variables:
107 ;; mode: emacs-lisp
108 ;; End: