*** empty log message ***
[m17n/m17n-db.git] / FLT / TELU-OTF.flt
1 ;; TELU-OTF.flt -- Font Layout Table for Telugu OpenType fonts
2 ;; Copyright (C) 2004, 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> TELU-OTF.flt
25 ;;;
26 ;;; For Telugu OpenType fonts to draw Telugu.
27 ;;; Designed for Pothana2000.ttf <http://www.kavya-nandanam.com/>
28
29 (font layouter telu-otf nil
30       (font (nil nil unicode-bmp :otf=telu=haln)))
31
32 (category
33  ;; C: general consonant
34  ;; H: HALANT
35  ;; u: MATRA (above)
36  ;; b: MATRA (below)
37  ;; p: MATRA (post)
38  ;; t: MATRA (two-part)
39  ;; a: vowel modifier (post)
40  ;; V: independent vowel
41  ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
42  ;; J: ZWJ (ZERO WIDTH JOINER)
43  ;; E: ELSE
44  ;;
45  (0x200C        ?N)                     ; ZWNJ
46  (0x200D        ?J)                     ; ZWJ
47  (0x0964        ?E)                     ; DANDA
48  (0x0965        ?E)                     ; DOUBLE DANDA
49  (0x0C00 0x0C7F ?E)                     ; ELSE
50  (0x0C01 0x0C03 ?a)                     ; post signs
51  (0x0C05 0x0C14 ?V)                     ; LETTER A .. LETTER AU
52  (0x0C15 0x0C39 ?C)                     ; LETTER KA .. LETTER HA
53  (0x0C3E 0x0C40 ?u)                     ; VOWEL SIGN AA, I, II (above)
54  (0x0C41 0x0C44 ?p)                     ; VOWEL SIGN U, UU, R, RR (post)
55  (0x0C46 0x0C47 ?u)                     ; VOWEL SIGN E, EE (above)
56  (0x0C48        ?t)                     ; VOWEL SIGN AI (two-part)
57  (0x0C4A 0x0C4C ?u)                     ; VOWEL SIGN O, OO, AU (above)
58  (0x0C4D        ?H)                     ; SIGN VIRAMA (HALANT)
59  (0x0C55        ?u)                     ; LENGTH MARK (above)
60  (0x0C56        ?b)                     ; AI LENGTH MARK (below)
61  (0x0C60 0x0C61 ?V)                     ; LETTER VOCALIC RR, LL
62  (0x0C7E        ?Y)                     ; internal use
63  (0x0C7F        ?X)                     ; internal use
64  )
65
66 ;; Step 1 : Syllable identification and Halant movement.
67 (generator
68  (0
69   (cond
70    ;; A syllable containing a two-part vowel sign.
71    ("(C(HC)*)(t)(a)?"
72     < | (1 move-base-Halant) (3 0x0C46 0x0C56) (4 =) | >)
73
74    ;; A syllable ending with vowel signs and/or a vowel modifier.
75    ("(C(HC)*)([ubp]+a?|a)"
76     < | (1 move-base-Halant) (3 = *) | >)
77
78    ;; Forced Halant form
79    ("(CH)N"
80     < | (1 move-base-Halant) | >)
81
82    ;; A syllable without a vowel sign nor a vowel modifier.
83    ("C(HC)*H?"
84     < | move-base-Halant | >)
85
86    ;; A syllable starting with an independent vowel.
87    ("Va?"
88     < | = * | > )
89
90    ("." =))
91   *)
92
93  ;; Move Halant on the base consonant to the tail if the syllable ends
94  ;; with a consonant.
95  ;; A leading 0x0C7F means Halant movement.
96  ;; A leading 0x0C7E means a syllable ending with a Halant.
97  (move-base-Halant
98   (cond
99    (".*H$"
100     0x0C7E = *)
101    ("(.)(H)(.*)"
102     0x0C7F (1 =) (3 = *) (2 =))
103    (".*"
104     = *))))
105
106 ;; Step 2 : Move Matra if applicable.
107 ;; The base consonant in a Halant-ending syllable is changed into Halant form.
108 (generator
109  (0
110   (cond
111    ;;  1  2      3   4   5   6
112    (" X(.)([CH]*)(u)?(b)?(p)?(a)? "
113     | (1 =) (3 =) (4 =) (5 =) (2 = *) (6 =) |)
114    (" Y(..)([^ ]*) "
115     | (1 otf:telu=haln) (2 = *) |)
116    ("." =))
117   *))
118
119 ;; Step 3 : Drive OTF tables.
120 (generator
121  (0
122   (cond
123    (" ([^ ]*) "
124     (1 otf:telu))
125    ("."
126     [ otf:telu=+ ]))
127   *))
128
129 ;; Local Variables:
130 ;; mode: emacs-lisp
131 ;; End: