1;; MLYM-RACHANA.flt -- Font Layout Table for Malayalam Rachana font
2;; Copyright (C) 2005, 2007  AIST (H15PRO112)
3;; See the end for copying conditions.
4
5(font layouter mlym-rachana nil
6      (font (nil rachana unicode-bmp)))
7
8;;; <li> MLYM-RACHANA.flt
9;;;
10;;; For the Rachana Malayalam fonts to draw the traditional Malayalam
11;;; script.  This fonts handles virtually all ligatures with the AKHN
12;;; feature without character reordering.
13
14;; The first stage is to extract a syllable and re-order characters.
15(category
16 ;; C: consonant
17 ;; H: HALANT
18 ;; m: MATRA (Mpre)
19 ;; p: MATRA (Mpost)
20 ;; t: MATRA (two-part: Mpre+Mpost)
21 ;; A: vowel modifier (post) (ANUSVARA and VISARGA)
22 ;; V: independent vowel
23 ;; E: else (all other independnt characters)
24 (0x0D00 0x0D7F	?E)			; else
25 (0x0D02 0x0D03	?A)			; ANUSVARA & VISARGA
26 (0x0D05 0x0D14	?V)			; independent vowel
27 (0x0D15 0x0D39 ?C)			; consonant
28 (0x0D3E 0x0D43	?p)			; dependent vowel (Mpost)
29 (0x0D46 0x0D48	?m)			; dependent vowel (Mpre)
30 (0x0D4A 0x0D4C ?t)			; dependent vowel (two-part)
31 (0x0D4D	?H)			; VIRAMA (HALANT)
32 (0x0D57	?p)			; dependent vowel (Mpost)
33 (0x0D60	?V)			; VOCALIC RR
34 (0x0D61	?V)			; VOCALIC LL
35 (0x0D7F	?x)			; Internal use
36 (0x200C	?N)			; ZERO WIDTH NON-JOINER
37 (0x200D	?J)			; ZERO WIDTH JOINER
38 )
39
40;; Step 0.  Syllable identification.
41(generator
42 (0
43  (cond
44   ;; Halant + ZWNJ -- forced explicit halant.
45   ("((CH)*C)HN"
46    < | (1 otf:mlym=akhn,psts,haln) 0x0D4D | >)
47
48   ;; Halant + ZWJ -- forced cillaksaram.
49   ("(CH)*(CH)J"
50    < | (1 otf:mlym=akhn,psts,haln) (2 otf:mlym=haln) | >)
51
52   ;; Pre-consonant vowel is temporarily moved to the leftmost
53   ;; position to permit consonant ligature.
54   ("((CH)*C)(m)(A?)"
55    < | (3 =) (1 otf:mlym=akhn,psts,haln) 0x0D7F (4 =) | >)
56
57   ;; Two-part vowel sign.
58   ("((CH)*C)(t)(A?)"
59    < | (3 pre) (1 otf:mlym=akhn,psts,haln) 0x0D7F (3 post) (4 =) | >)
60
61   ;; Post-consonant vowel sign and/or vowel modifier.
62   ("((CH)*C(pA?|A))"
63    < | (1 otf:mlym=akhn,psts,haln) | >)
64
65   ;; No vowel sign.
66   ("((CH)*C(H?))"
67    < | (1 otf:mlym=akhn,psts,haln) | >)
68
69   ;; A syllable starting with an independent vowel.
70   ("(VA?)"
71    < | (1 = *) | >)
72
73   ;; Other dedependent character.
74   ("[Apmt]" [ = ])
75
76   ;; Other independent character.
77   ("." =))
78  *)
79
80 ;; Former part of two-part vowel sign.
81 (pre
82  (cond
83   ((0x0D4A) 0x0D46)
84   ((0x0D4B) 0x0D47)
85   ((0x0D4C) 0x0D46)))
86
87 ;; Latter part of two-part vowel sign.
88 (post
89  (cond
90   ((0x0D4A) 0x0D3E)
91   ((0x0D4B) 0x0D3E)
92   ((0x0D4C) 0x0D57))))
93
94;; Step 1.  Move Mpre to the left of base consonant(-cluster).
95(generator
96 (0
97  (cond
98   (" (m)([^x]*)([^x])x([^ ]*) "
99    (2 = *) (1 =) (3 =) (4 = *))
100   ("."
101    =))
102  *))
103
104;; Step 2. Finalise.
105(generator
106 (0
107  (cond
108   (" ([^ ]*) " (1 otf:mlym=+))
109   ("." =))
110  *))
111
112;; Copyright (C) 2005, 2007
113;;   National Institute of Advanced Industrial Science and Technology (AIST)
114;;   Registration Number H15PRO112
115
116;; This file is part of the m17n database; a sub-part of the m17n
117;; library.
118
119;; The m17n library is free software; you can redistribute it and/or
120;; modify it under the terms of the GNU Lesser General Public License
121;; as published by the Free Software Foundation; either version 2.1 of
122;; the License, or (at your option) any later version.
123
124;; The m17n library is distributed in the hope that it will be useful,
125;; but WITHOUT ANY WARRANTY; without even the implied warranty of
126;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
127;; Lesser General Public License for more details.
128
129;; You should have received a copy of the GNU Lesser General Public
130;; License along with the m17n library; if not, write to the Free
131;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
132;; Boston, MA 02110-1301, USA.
133
134;; Local Variables:
135;; mode: emacs-lisp
136;; End:
137