*** empty log message ***
[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., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, 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 dedependent character.
90    ("[Apmt]" [ = ])
91
92    ;; Other independent character.
93    ("." =))
94   *)
95
96  ;; Former part of two-part vowel sign.
97  (pre
98   (cond
99    ((0x0D4A) 0x0D46)
100    ((0x0D4B) 0x0D47)
101    ((0x0D4C) 0x0D46)))
102
103  ;; Latter part of two-part vowel sign.
104  (post
105   (cond
106    ((0x0D4A) 0x0D3E)
107    ((0x0D4B) 0x0D3E)
108    ((0x0D4C) 0x0D57))))
109
110 ;; Step 1.  Move Mpre to the left of base consonant(-cluster).
111 (generator
112  (0
113   (cond
114    (" (m)([^x]*)([^x])x([^ ]*) "
115     (2 = *) (1 =) (3 =) (4 = *))
116    ("."
117     =))
118   *))
119
120 ;; Step 2. Finalise.
121 (generator
122  (0
123   (cond
124    (" ([^ ]*) " (1 otf:mlym=+))
125    ("." =))
126   *))
127
128 ;; Local Variables:
129 ;; mode: emacs-lisp
130 ;; End: