1 ;; KNDA-OTF.flt -- Font Layout Table for Kannada OpenType fonts
2 ;; Copyright (C) 2004, 2007
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n database; a sub-part of the m17n
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.
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.
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.
26 ;;; For Kannada OpenType fonts to draw Kannada.
27 ;;; Designed for Kedage-n.ttf <http://brahmi.sourceforge.net/downloads.html>
29 (font layouter knda-otf nil
30 (font (nil nil unicode-bmp :otf=knda=rphf)))
33 ;; C: consonant (except for RA)
37 ;; u: vowel sign (above)
38 ;; b: vowel sign (below)
39 ;; p: vowel sign (post)
41 ;; a: vowel modifier (post)
42 ;; V: independent vowel
43 ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
44 ;; J: ZWJ (ZERO WIDTH JOINER)
46 (0x0C80 0x0CFF ?X) ; generic
47 (0x0C82 0x0C83 ?a) ; SIGN ANUSVARA .. VISARGA
48 (0x0C85 0x0C94 ?V) ; LETTER A .. LETTER AU
49 (0x0C95 0x0CB9 ?C) ; LETTER KA .. LETTER HA
50 (0x0CB0 ?R) ; LETTER RA
51 (0x0CBC ?n) ; SIGN NUKTA
52 (0x0CBE ?p) ; VOWEL SIGN AA
53 (0x0CBF ?u) ; VOWEL SIGN I
54 (0x0CC1 0x0CC4 ?p) ; VOWEL SIGN U .. RR
55 (0x0CC6 ?u) ; VOWEL SIGN E
56 (0x0CCC ?u) ; VOWEL SIGN AU
57 (0x0CCD ?H) ; SIGN VIRAMA
58 (0x0CD5 0x0CD6 ?l) ; LENGTH MARK .. AI LENGTH MARK
59 (0x0CDE ?C) ; LETTER FA (LLLA)
60 (0x0CE0 0x0CE1 ?V) ; LETTER VOCALIC RR .. LL
61 (0x0CE2 0x0CE3 ?b) ; VOWEL SIGN VOCALIC L .. LL
62 (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
71 ;; Decompose two-part and three-part vowels
82 ;; Move ZWJ between RA and HARANT.
88 ;; Syllable identification.
89 ;; Apply 'nukt' and 'akhn' before reordering.
94 ;; A syllable with an above vowel sign.
96 ("(J)?([CR]n?(H[CR]n?)*)(up?l?a?)"
97 < | (1 =) (2 otf:knda=nukt,akhn+) (4 = *) | >)
99 ;; A syllable with a post- or below vowel sign.
101 ("(J)?([CR]n?(H[CR]n?)*)(p|b)(a)?"
102 < | (1 =) (2 otf:knda=nukt,akhn+) (4 =) (5 =) | >)
104 ;; A syllable with a vowel modifier, but without vowel signs.
106 ("(J)?([CR]n?(H[CR]n?)*)(a)"
107 < | (1 =) (2 otf:knda=nukt,akhn+) (4 =) | >)
109 ;; No vowel signs, no vowel modifiers.
111 ("(J)?([CR]n?(H[CR]n?)*)(H|HN)?"
112 < | (1 =) (2 otf:knda=nukt,akhn+) (4 = *) | >)
114 ;; A syllable starting with an independent vowel.
121 ;; Reordering. The base consonant is always the first one, because
122 ;; all Kannada consonants have a below form.
127 (" (RH)?([^N])((H[^N])*)(u|b)?(p)?(l)?(a)? "
128 | (2 =) (5 =) (6 =) (3 move-h) (7 =) (1 otf:knda=rphf+) (8 =) |)
130 ;; A syllable ending with a halant.
132 (" (RH)?(.H)((.H)*)N? "
133 ;; WORKAROUND : Kedage fonts produce halant form with 'psts'.
134 | (2 otf:knda=haln,psts+)(3 = *) (1 otf:knda=rphf+) |)
136 ;; No reph movement if preceded by a ZWJ.
138 (" J(.)((H[^N])*)(u|b)?(p)?(l?a?) "
139 | (1 =) (4 =) (5 =) (2 move-h) (6 = *) |)
143 | (1 otf:knda=haln,psts+) (2 = *) |)
153 ;; Apply other OTF features.
158 (1 otf:knda=blwf,abvs,blws,psts+abvm,blwm,dist))