*** empty log message ***
[m17n/m17n-db.git] / FLT / TIBT-OTF.flt
1 ;; TIBT-OTF.flt -- Font Layout Table for Tibetan (OpenType font)
2 ;; Copyright (C) 2005, 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> TIBT-OTF.flt
25 ;;;
26 ;;; For TibetanMachineUniAlpha.ttf to draw Tibetan script.
27 ;;; The font is available at:
28 ;;; <ul>
29 ;;; <li> infopage: http://www.thdl.org/
30 ;;; <li> download: http://ftp.debian.org/debian/pool/main/t/ttf-tmuni/ttf-tmuni_0.0.20040806.orig.tar.gz
31 ;;; </ul>
32
33 (font layouter tibt-otf nil
34       (font (nil nil unicode-bmp :otf=tibt=ccmp,blws,abvs)))
35
36 ;; Step 0: Reordering Characters
37 ;;
38 ;; According to the Unicode canonical combining class value (CCCV),
39 ;; Tibetan combining characters must be orderd in the following way:
40 ;;
41 ;; MARK HALANTA (CCCV=9)
42 ;; VOWEL SIGN AA (129)
43 ;; Above base vowel signs (130)
44 ;; VOWEL SIGN U (132)
45 ;; MARK TSA -PHRU (216)
46 ;;
47 ;; However, the current font expects the following order:
48 ;;
49 ;; MARK TSA -PHRU
50 ;; VOWEL SIGN AA
51 ;; VOWEL SIGN U
52 ;; MARK HALANTA
53 ;; Above base vowel signs
54
55 (category
56  (0x0F00 0x0FCF         ?x)             ; default
57  (0x0F39                ?T)             ; MARK TSA -PHRU
58  (0x0F71                ?A)             ; VOWEL SIGN AA
59  (0x0F72                ?V)             ; VOWEL SIGN I
60  (0x0F74                ?U)             ; VOWEL SIGN U
61  (0x0F7A 0x0F7D         ?V)             ; VOWEL SIGN E .. VOWEL SIGN OO
62  (0x0F80                ?V)             ; VOWEL SIGN REVERSED I
63  (0x0F84                ?H))            ; MARK HALANTA
64
65 (generator
66  (0
67   (cond
68    ("x+"
69     = *)
70    ("(H?)(A*)(V?)(U*)(T?)"
71     (5 =) (2 = *) (4 = *) (1 =) (3 =)))
72   *))
73
74 ;; Step 1: Syllable identification
75
76 ;; C: Consonants
77 ;; T: MARK TSA -PHRU
78 ;; c: Subjoind consonants
79 ;; A: VOWEL SIGN AA
80 ;; U: VOWEL SIGN U
81 ;; H: MARK HALANTA
82 ;; V: Above or two-part vowel signs
83 ;; S: Above base signs
84 ;; s: Other above base signs
85 ;; x: Others
86
87 (category
88  (0x0F00 0x0FCF         ?x)             ; default
89  (0x0F39                ?T)             ; MARK TSA -PHRU
90  (0x0F40 0x0F6A         ?C)             ; LETTER KA .. LETTER FIXED-FORM RA
91  (0x0F71                ?A)             ; VOWEL SIGN AA
92  (0x0F72 0x0F7E         ?V)             ; VOWEL SIGN I .. SIGN RJES SU NGA RO
93  (0x0F74                ?U)             ; VOWEL SIGN U
94  (0x0F80 0x0F81         ?V)             ; VOWEL SIGN REVERSED I, REVERSED II
95  (0x0F82 0x0F83         ?S)             ; SIGN NYI ZLA NAADA, SIGN SNA LDAN
96  (0x0F84                ?H)             ; MARK HALANTA
97  (0x0F86 0x0F87         ?s)             ; SIGN LCI RTAGS, SIGN YANG RTAGS
98  (0x0F88 0x0F89         ?C)             ; SIGN LCE TSA CAN, SIGN MCHU CAN
99  (0x0F90 0x0FBC         ?c))            ; SUBJOIND LETTER KA .. FIXED-FORM RA
100
101 (generator
102  (0
103   (cond
104    ;; For some reason, it is better not to apply the abvs feature when
105    ;; both A and U exist.
106    ("(C)(T?)(c*)(A*)(U*)(H?)(V*)(S*)(s*)"
107     otf:tibt=ccmp,blws,abvs)
108    ("."
109     =))
110   *))
111
112 ;; Local Variables:
113 ;; mode: lisp
114 ;; coding: utf-8
115 ;; End: