Files updated
[m17n/m17n-db.git] / MLYM-RACHANA.flt
1 ;; MLYM-RACHANA.flt -- Font Layout Table for Malayalam Rachana font
2 ;; Copyright (C) 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> MLYM-RACHANA.flt
25 ;;;
26 ;;; For the Rachana Malayalam fonts to draw the traditional Malayalam
27 ;;; script.  This fonts handles virtually all ligatures with the AKHN
28 ;;; feature without character reordering.
29
30 ;; The first stage is to extract a syllable and re-order characters.
31 (category
32  ;; C: consonant
33  ;; H: HALANT
34  ;; m: MATRA (Mpre)
35  ;; p: MATRA (Mpost)
36  ;; t: MATRA (two-part: Mpre+Mpost)
37  ;; A: vowel modifier (post) (ANUSVARA and VISARGA)
38  ;; V: independent vowel
39  ;; E: else (all other independnt characters)
40  (0x0D00 0x0D7F ?E)                     ; else
41  (0x0D02 0x0D03 ?A)                     ; ANUSVARA & VISARGA
42  (0x0D05 0x0D14 ?V)                     ; independent vowel
43  (0x0D15 0x0D39 ?C)                     ; consonant
44  (0x0D3E 0x0D43 ?p)                     ; dependent vowel (Mpost)
45  (0x0D46 0x0D48 ?m)                     ; dependent vowel (Mpre)
46  (0x0D4A 0x0D4C ?t)                     ; dependent vowel (two-part)
47  (0x0D4D        ?H)                     ; VIRAMA (HALANT)
48  (0x0D57        ?p)                     ; dependent vowel (Mpost)
49  (0x0D60        ?V)                     ; VOCALIC RR
50  (0x0D61        ?V)                     ; VOCALIC LL
51  (0x0D7F        ?x)                     ; Internal use
52  (0x200C        ?N)                     ; ZERO WIDTH NON-JOINER
53  (0x200D        ?J)                     ; ZERO WIDTH JOINER
54  )
55
56 ;; Step 0.  Syllable identification.
57 (generator
58  (0
59   (cond
60    ;; Halant + ZWNJ -- forced explicit halant.
61    ("((CH)*C)HN"
62     < | (1 otf:mlym=akhn,psts,haln) 0x0D4D | >)
63
64    ;; Halant + ZWJ -- forced cillaksaram.
65    ("(CH)*(CH)J"
66     < | (1 otf:mlym=akhn,psts,haln) (2 otf:mlym=haln) | >)
67
68    ;; Pre-consonant vowel is temporarily moved to the leftmost
69    ;; position to permit consonant ligature.
70    ("((CH)*C)(m)(A?)"
71     < | (3 =) (1 otf:mlym=akhn,psts,haln) 0x0D7F (4 =) | >)
72
73    ;; Two-part vowel sign.
74    ("((CH)*C)(t)(A?)"
75     < | (3 pre) (1 otf:mlym=akhn,psts,haln) 0x0D7F (3 post) (4 =) | >)
76
77    ;; Post-consonant vowel sign and/or vowel modifier.
78    ("((CH)*C(pA?|A))"
79     < | (1 otf:mlym=akhn,psts,haln) | >)
80
81    ;; No vowel sign.
82    ("((CH)*C(H?))"
83     < | (1 otf:mlym=akhn,psts,haln) | >)
84
85    ;; A syllable starting with an independent vowel.
86    ("(VA?)"
87     < | (1 = *) | >)
88
89    ;; Other independent character.
90    ("." =))
91   *)
92
93  ;; Former part of two-part vowel sign.
94  (pre
95   (cond
96    ((0x0D4A) 0x0D46)
97    ((0x0D4B) 0x0D47)
98    ((0x0D4C) 0x0D46)))
99
100  ;; Latter part of two-part vowel sign.
101  (post
102   (cond
103    ((0x0D4A) 0x0D3E)
104    ((0x0D4B) 0x0D3E)
105    ((0x0D4C) 0x0D57))))
106
107 ;; Step 1.  Move Mpre to the left of base consonant(-cluster).
108 (generator
109  (0
110   (cond
111    (" (m)([^x]*)([^x])x([^ ]*) "
112     (2 = *) (1 =) (3 =) (4 = *))
113    ("."
114     =))
115   *))
116
117 ;; Step 2. Finalise.
118 (generator
119  (0
120   (cond
121    (" ([^ ]*) " (1 otf:mlym=+))
122    ("." =))
123   *))
124
125 ;; Local Variables:
126 ;; mode: emacs-lisp
127 ;; End: