;; GURU-OTF.flt -- Font Layout Table for Gurmukhi OpenType fonts
-;; Copyright (C) 2004, 2007, 2008 AIST (H15PRO112)
+;; Copyright (C) 2004, 2007, 2008, 2010 AIST (H15PRO112)
;; See the end for copying conditions.
(font layouter guru-otf nil
- (font (nil nil unicode-bmp :otf=guru=blwf)))
+ (version "1.6.0")
+ (font (nil nil unicode-bmp :otf=guru)))
;;; <li> GURU-OTF.flt
;;;
;;; For Gurmukhi OpenType fonts to draw the Gurmukhi script.
(category
- ;; C: general consonant (except for R and Y)
- ;; R: consonant (below)
- ;; Y: consonant YA
- ;; n: NUKTA
- ;; H: HALANT
- ;; m: vowel sign (pre)
- ;; u: vowel sign (above)
- ;; b: vowel sign (below)
- ;; p: vowel sign (post)
- ;; A: vowel modifier (above)
- ;; a: vowel modifier (post)
- ;; V: independent vowel
- ;; d: ADDAK
- ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
- ;; J: ZWJ (ZERO WIDTH JOINER)
- ;; X: generic
- ;; Z: internal use
+ ;; B: consonants that have a below form
+ ;; C: consonants that do not
(0x0A00 0x0A7F ?X) ; generic
(0x0A00 ?Z) ; internal use
- (0x0A01 0x0A02 ?A) ; SIGN ADAK BINDI .. BINDI
- (0x0A03 ?a) ; SIGN VISARGA
+ (0x0A01 0x0A02 ?a) ; SIGN ADAK BINDI .. BINDI
+ (0x0A03 ?A) ; SIGN VISARGA
(0x0A05 0x0A14 ?V) ; LETTER A .. AU
(0x0A15 0x0A38 ?C) ; LETTER KA .. SA
(0x0A2F ?Y) ; LETTER YA
- (0x0A30 ?R) ; LETTER RA
- (0x0A35 ?R) ; LETTER VA
- (0x0A39 ?R) ; LETTER HA
+ (0x0A30 ?B) ; LETTER RA
+ (0x0A35 ?B) ; LETTER VA
+ (0x0A39 ?B) ; LETTER HA
(0x0A3C ?n) ; SIGN NUKTA
(0x0A3E ?p) ; VOWEL SIGN AA
(0x0A3F ?m) ; VOWEL SIGN I
(0x0A4D ?H) ; SIGN VIRAMA
;; (0x0A51 ?) ; SIGN UDAAT
(0x0A59 0x0A5E ?C) ; LETTER KHHA .. FA
- (0x0A70 ?A) ; TIPPI
+ (0x0A70 ?a) ; TIPPI
(0x0A71 ?d) ; ADDAK
;; (0x0A75 ?) ; SIGN YAKASH
- (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
+
(0x200C ?N) ; ZWNJ
(0x200D ?J) ; ZWJ
+ (0x25CC ?X) ; DOTTED CIRCLE
+
+ (pstf ?P)
)
-;; Compose consonant and nukta
+;; Stage 0
+;; Preprocessing
(generator
(0
(cond
+ ;; Compose a consonant and a nukta
((0x0A32 0x0A3C) 0x0A33)
((0x0A38 0x0A3C) 0x0A36)
((0x0A16 0x0A3C) 0x0A59)
("." =))
*))
-;; Reordering
+;; Stage 1
+;; Syllable identification
+(generator
+ (0
+ (cond
+ ;; Consonant-based syllables
+ ;;1 23 4
+ ("([CBY]n?((J?H|HJ?)[CBY]n?)*)(H[NJ]?|m?u?b?p?n?a?A?)"
+ < |
+ (cond
+ (".+HJ$" :otf=guru=nukt,akhn+)
+ ("(.+)(H)N?$" (1 :otf=guru=nukt,akhn+) (2 =) 0x200C)
+ (".+" :otf=guru=nukt,akhn+))
+ | >)
+
+ ;; Syllables with an independent vowel
+ ("(Vn?)((J?H[BY])?m?u?b?p?n?a?A?)"
+ < | (1 :otf=guru=nukt+) (2 = *) | >)
+
+ ;; Combining marks are displayed with a DOTTED CIRCLE.
+ ("m"
+ (cond
+ ((font-facility 0x25CC) < = 0x25CC >)
+ ("." [ = ])))
+ ("[nHubpaA]"
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = >)
+ ("." [ = ])))
+
+ ;; Isolated blwf and pstf are displayed with a DOTTED CIRCLE in the
+ ;; next stage.
+ ("(J)(H)([BY])"
+ < | (1 =) (3 =) (2 =) | >)
+
+ ("." =))
+ *))
+
+;; Stage 2
+;; Reorder halant for blwf and pstf
+(generator
+ (0
+ (cond
+ ;; Isolated blwf and pstf
+ ;; Saab.ttf uses vatu instead of blwf.
+ (" J([BY]H) "
+ (cond
+ ((font-facility 0x25CC) < 0x25CC (1 :otf=guru=blwf,pstf,vatu+) >)
+ (" J([BYR]H) " [ (1 :otf=guru=blwf,pstf,vatu+) ])))
+
+ ;; Syllables with an overt halant
+ (" ([^ ]+)(HN) "
+ | (1 reorder) (2 = =) |)
+
+ ;; Ordinary syllables
+ (" ([^mubpaA ]+)(m?u?b?p?n?a?A?) "
+ | (1 reorder) (2 = *) |)
+
+ ("." =))
+ *)
+
+ (reorder
+ ("(.|.+([^YJ]|JY|HJ))((J?HY)*)$"
+ (1 reorder-B *) (3 reorder-Y *)))
+
+ (reorder-B
+ (cond
+ ("J?(H)(B)"
+ (2 =) (1 =))
+ ("." =)))
+
+ (reorder-Y
+ ("J?(H)(Y)"
+ (2 =) (1 =)))
+ )
+
+;; Stage 3
+;; Language forms and matra reordering
(generator
(0
(cond
- ;; A syllable with vowel signs.
- ;;1 2 34 5 6 7
- ("([CRY]n?(H[CRY]n?)*)((m)|(ub?|b)|(p))(A?a?d?)"
- < | (4 =) (1 pre-below) (5 = *) (1 post) (6 =) (7 = *) | >)
-
- ;; A syllable with vowel modifiers or an Addak.
- ;;1 2 3
- ("([CRY]n?(H[CRY]n?)*)(Aa?d?|ad?|d)"
- < | (1 pre-below) (1 post) (3 = *) | >)
-
- ;; Add a ZWNJ explicitly when a syllable ends with a halant.
- ;;1 2 3
- ("([CRY]n?(H[CRY]n?)*)(HN?)?"
- < | (1 pre-below) (3 = 0x200C) (1 post) | >)
-
- ;; A syllable starting with an independent vowel.
- ;; In older texts, LETTER OO may followed by VOWEL SIGN U.
- ("Vb?A?a?d?"
- < | = * | >)
+ ;; Overt halant forms
+ (" ([^ ]+)(HN) "
+ | (1 b4post) (1 post) (2 = =) |)
+
+ ;; Other syllables
+ ;; 1 2 3 4 5 6 7
+ (" ([^mubpaA ]*)(mn?)?(un?)?(bn?)?(pn?)?(a)?(A)? "
+ | (2 = *) (1 b4post) (4 = *) (3 = *) (6 =) (1 post) (5 = *) (7 =) |)
("." =))
*)
- ;; Move the halant after the base consonant to the end.
- ;; Fill the resulting gap with a special mark.
- ;; Remove post-base parts.
- (pre-below
+ (b4post
(cond
- ("(.+)(H)(R)(HY)?$"
- (1 = *) 0x0A00 (3 =) (2 =))
- ("(.+)HY$"
- (1 = *) 0x0A00)
- (".+"
- = * 0x0A00)))
-
- ;; Extract post-base parts and add a halant at the end.
- ;; Produce nothing if there are no post-base parts.
+ ("(.H)J?(.*)"
+ (1 :otf=guru=half+)
+ (2 ("(.|.+([^YH]|JY|BH))((YH)*)$" (1 lang-forms *))))
+ ("(.|.+([^YH]|JY|BH))((YH)*)"
+ (1 lang-forms *))))
+
+ (lang-forms
+ (cond
+ ("(.H)J" (1 :otf=guru=half+))
+ (".H" :otf=guru=blwf,half,vatu+)
+ ("." =)))
+
(post
+ ("(.|.+([^YH]|JY|BH))((YH)+)$"
+ ;; lohit_pa.ttf uses psts instead of pstf for YA.
+ (3 :otf=guru=pstf+psts)))
+ )
+
+;; Stage 4
+;; Final reordering (Move pre-base matra after the last halant)
+(generator
+ (0
(cond
- (".*(H)(Y)$"
- (2 =) (1 =))
- (".+"
- ))))
+ ;; 1 2 3
+ (" (mn?)([^ ]+HJ?)([^H ]+) "
+ | (2 = *) (1 = *) (3 = *) |)
-;; Apply language forms to concerning segments. Note that the Saab
-;; font generates below form with 'vatu' instead of 'blwf'.
+ ("." =))
+ *))
+
+;; Stage 5
+;; Nukta for matra and Presentation forms
(generator
(0
(cond
- ;; Explicit Halant.
- ;; 1 2 3 4
- (" ([^Z]+)Z(RH)?(H)N(YH)? "
- | (1 otf:guru=nukt+) (2 otf:guru=blwf,vatu+) (3 =) (4 otf:guru=pstf+) |)
+ (" ([^ ]+) "
+ ;; lohit_pa.ttf uses vatu instead of blws.
+ | (1 :otf=guru=nukt,vatu,pres,abvs,blws,psts,haln+) |)
- ;; Vowel signs and vowel modifiers.
- ;; 1 2 3 4 5 6
- (" (m)?([^Z]+)Z(RH)?(u?b?)(YH)?(p?A?a?d?) "
- | (1 =) (2 otf:guru=nukt+) (3 otf:guru=blwf,vatu+) (4 = *)
- (5 otf:guru=pstf+) (6 = *) |)
+ ("." =))
+ *))
+
+;; Stage 6
+;; Remove ZWNJ/ZWJ
+(generator
+ (0
+ (cond
+ ("[NJ]")
("." =))
*))
-;; Other features
+;; Stage 7
+;; GPOS processing
(generator
(0
(cond
(" ([^ ]+) "
- (1 otf:guru=vatu,pres,abvs,blws,psts,haln+abvm,blwm,dist))
+ (1 :otf=guru=+abvm,blwm,dist))
- ("."
- [ = ]))
+ ("." =))
*))
-;; Copyright (C) 2004, 2007, 2008
+;; Copyright (C) 2004, 2007, 2008, 2010
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; KNDA-OTF.flt -- Font Layout Table for Kannada OpenType fonts
-;; Copyright (C) 2004, 2007 AIST (H15PRO112)
+;; Copyright (C) 2004, 2007, 2010 AIST (H15PRO112)
;; See the end for copying conditions.
(font layouter knda-otf nil
- (font (nil nil unicode-bmp :otf=knda=rphf)))
+ (version "1.6.0")
+ (font (nil nil unicode-bmp :otf=knda)))
;;; <li> KNDA-OTF.flt
;;;
;;; For Kannada OpenType fonts to draw the Kannada script.
(category
- ;; C: consonant (except for RA)
- ;; R: RA
- ;; n: NUKTA
- ;; H: HALANT
- ;; u: vowel sign (above)
- ;; b: vowel sign (below)
- ;; p: vowel sign (post)
- ;; l: length mark
- ;; a: vowel modifier (post)
- ;; V: independent vowel
- ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
- ;; J: ZWJ (ZERO WIDTH JOINER)
- ;; X: generic
+ ;; b: before subscript matras
+ ;; a: after subscript matras
(0x0C80 0x0CFF ?X) ; generic
- (0x0C82 0x0C83 ?a) ; SIGN ANUSVARA .. VISARGA
+ (0x0C82 0x0C83 ?A) ; SIGN ANUSVARA .. VISARGA
(0x0C85 0x0C94 ?V) ; LETTER A .. LETTER AU
(0x0C95 0x0CB9 ?C) ; LETTER KA .. LETTER HA
(0x0CB0 ?R) ; LETTER RA
(0x0CBC ?n) ; SIGN NUKTA
- (0x0CBE ?p) ; VOWEL SIGN AA
- (0x0CBF ?u) ; VOWEL SIGN I
- (0x0CC1 0x0CC4 ?p) ; VOWEL SIGN U .. RR
- (0x0CC6 ?u) ; VOWEL SIGN E
- (0x0CCC ?u) ; VOWEL SIGN AU
+ (0x0CBE 0x0CBF ?b) ; VOWEL SIGN AA .. I
+ (0x0CC1 0x0CC2 ?b) ; VOWEL SIGN U .. UU
+ (0x0CC3 0x0CC4 ?a) ; VOWEL SIGN VOCALIC R .. VOCALIC RR
+ (0x0CC6 ?b) ; VOWEL SIGN E
+ (0x0CCC ?b) ; VOWEL SIGN AU
(0x0CCD ?H) ; SIGN VIRAMA
- (0x0CD5 0x0CD6 ?l) ; LENGTH MARK .. AI LENGTH MARK
+ (0x0CD5 0x0CD6 ?a) ; LENGTH MARK .. AI LENGTH MARK
(0x0CDE ?C) ; LETTER FA (LLLA)
- (0x0CE0 0x0CE1 ?V) ; LETTER VOCALIC RR .. LL
- (0x0CE2 0x0CE3 ?b) ; VOWEL SIGN VOCALIC L .. LL
- (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
+ (0x0CE0 0x0CE1 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
+ (0x0CE2 0x0CE3 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
+
(0x200C ?N) ; ZWNJ
(0x200D ?J) ; ZWJ
+ (0x25CC ?X) ; DOTTED CIRCLE
+
+ (blwf ?B)
+ (rphf ?r)
)
-;; Preprocessing.
+;; Stage 0
+;; Preprocessing
(generator
(0
(cond
- ;; Decompose two-part and three-part vowel signs.
+ ;; Decompose multi-part vowel signs.
((0x0CC0)
0x0CBF 0x0CD5)
((0x0CC7)
0x0CC6 0x0CC2)
((0x0CCB)
0x0CC6 0x0CC2 0x0CD5)
- ;; Move ZWJ between RA and HARANT.
- ("(R)(J)(H)"
- (2 =) (1 =) (3 =))
+
("." =))
*))
-;; Syllable identification.
-;; Apply 'nukt' and 'akhn' before reordering.
-
+;; Stage 1
+;; Syllable identification
(generator
(0
(cond
- ;; A syllable with an above vowel sign.
- ;;1 2 3 4
- ("(J)?([CR]n?(H[CR]n?)*)(up?l?a?)"
- < | (1 =) (2 otf:knda=nukt,akhn+) (4 = *) | >)
-
- ;; A syllable with a post- or below vowel sign.
- ;;1 2 3 4 5
- ("(J)?([CR]n?(H[CR]n?)*)(p|b)(a)?"
- < | (1 =) (2 otf:knda=nukt,akhn+) (4 =) (5 =) | >)
-
- ;; A syllable with a vowel modifier, but without vowel signs.
- ;;1 2 3 4
- ("(J)?([CR]n?(H[CR]n?)*)(a)"
- < | (1 =) (2 otf:knda=nukt,akhn+) (4 =) | >)
-
- ;; No vowel signs, no vowel modifiers.
- ;;1 2 3 4
- ("(J)?([CR]n?(H[CR]n?)*)(HN?)?"
- < | (1 =) (2 otf:knda=nukt,akhn+) (4 = *) | >)
-
- ;; A syllable starting with an independent vowel.
- ("Va?"
- < | = * | >)
+ ;; Syllables with an independent vowel
+ ("(RH)?(Vn?)((J?H[CR])?b?b?a?A?)"
+ < | (1 = =) (2 :otf=knda=nukt+) (3 = *) | >)
+
+ ;; Consonant-based syllables
+ ;;1 23 4
+ ("([CR]n?((J?H|HJ?)[CR]n?)*)(H[NJ]?|b?b?a?n?A?)"
+ < |
+ (cond
+ (".+HJ$" :otf=knda=nukt,akhn+)
+ ("(.+)(H)N?$" (1 :otf=knda=nukt,akhn+) (2 =) 0x200C)
+ (".+" :otf=knda=nukt,akhn+))
+ | >)
+
+ ;; Multi-part vowel signs
+ ((0x0CBF 0x0CD5)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = >)
+ (".+" [ 0x0CC0 ])))
+ ((0x0CC6 0x0CD5)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = >)
+ (".+" [ 0x0CC7 ])))
+ ((0x0CC6 0x0CD6)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = >)
+ (".+" [ 0x0CC8 ])))
+ ((0x0CC6 0x0CC2 0x0CD5)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = = >)
+ (".+" [ 0x0CCB ])))
+ ((0x0CC6 0x0CC2)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = >)
+ (".+" [ 0x0CCA ])))
+
+ ;; Combining marks are displayed with a DOTTED CIRCLE.
+ ("[nHbaA]"
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = >)
+ ("." [ = ])))
+
+ ;; Isolated blwf is displayed with a DOTTED CIRCLE in the
+ ;; next stage.
+ ("(J)(H)([CR])"
+ < | (1 =) (3 =) (2 =) | >)
("." =))
*))
-;; Reordering. The base consonant is always the first one, because
-;; all Kannada consonants have a below form.
+;; Stage 2
+;; Reorder halant for blwf
(generator
(0
(cond
- ;; 1 2 34 5 6 7 8
- (" (RH)?([^N])((H[^N])*)(u|b)?(p)?(l)?(a)? "
- | (2 =) (5 =) (6 =) (3 move-h) (7 =) (1 otf:knda=rphf+) (8 =) |)
+ ;; Isolated blwf
+ (" J([CR]H) "
+ (cond
+ ((font-facility 0x25CC) < 0x25CC (1 :otf=knda=blwf+) >)
+ (" J([CR]H) " [ (1 :otf=knda=blwf+) ])))
+
+ ;; Syllables with an overt halant
+ (" (RHJ?)?([^ ]+)(HN) "
+ | (1 = *) (2 reorder *) (3 = =) |)
- ;; A syllable ending with a halant.
- ;; 1 2 34
- (" (RH)?(.H)((.H)*)N? "
- ;; WORKAROUND : Kedage fonts produce halant form with 'psts'.
- | (2 otf:knda=haln,psts+)(3 = *) (1 otf:knda=rphf+) |)
+ ;; Ordinary syllables
+ (" (RHJ?)?([^baA ]+)(b?b?n?a?n?A?) "
+ | (1 = *) (2 reorder *) (3 = *) |)
- ;; No reph movement if preceded by a ZWJ.
- ;; 1 23 4 5 6
- (" J(.)((H[^N])*)(u|b)?(p)?(l?a?) "
- | (1 =) (4 =) (5 =) (2 move-h) (6 = *) |)
+ ("." =))
+ *)
- ;; 1 23
- (" J(.H)((.H)*)N? "
- | (1 otf:knda=haln,psts+) (2 = *) |)
+ (reorder
+ (cond
+ ("J?(H)([CR])" (2 =) (1 =))
+ ("." =)))
+ )
+
+;; Stage 3
+;; Language forms
+;; Although all consonants have a blow form and none has a half form,
+;; we have to prevent the first consonant from forming the below form.
+(generator
+ (0
+ (cond
+ ;; Overt halant forms
+ (" (RHJ?)?([^ ]+)(HN) "
+ |
+ (1 (cond ("RHJ" = =)
+ ("RH" :otf=knda=rphf+)))
+ (2 (cond ("(.H)J?(.*)" (1 :otf=knda=half+) (2 lang-forms *))
+ (".+" lang-forms *)))
+ (3 = =) |)
+
+ ;; Other syllables
+ (" (RHJ?)?([^baA ]*)(b?b?n?a?n?A?) "
+ |
+ (1 (cond ("RHJ" = =)
+ ("RH" :otf=knda=rphf+)))
+ (2 (cond ("(.H)J?(.*)" (1 :otf=knda=half+) (2 lang-forms *))
+ (".+" lang-forms *)))
+ (3 = *) |)
("." =))
*)
- (move-h
+ (lang-forms
+ (cond
+ ("(.H)J" (1 :otf=knda=half+))
+ (".H" :otf=knda=blwf,half+)
+ ("." =)))
+ )
+
+;; Stage 4
+;; Final reordering #1 (Move before-subscript matras)
+(generator
+ (0
+ (cond
+ (" ([^B ]*[^BJ])J?(B*)(bb?n?)([^ ]*) "
+ | (1 = *) (3 = *) (2 = *) (4 = *) |)
+
+ ("." =))
+ *))
+
+;; Stage 5
+;; Final reordering #2 (Move reph after the first halant)
+(generator
+ (0
(cond
- ("(H)(.+)"
- (2 = *) (1 =)))))
+ ;; Syllables with a reph and an explicit halant
+ ;; 1 2 3
+ (" (r)([^H ]+HJ?)([^ ]*) "
+ | (2 = *) (1 =) (3 = *) |)
+
+ ;; A reph without explicit halant
+ ;; 1 2 3
+ (" (r)([^A ]+)(A)? "
+ | (2 = *) (1 =) (3 =) |)
-;; Apply other OTF features.
+ ("." =))
+ *))
+
+;; Stage 6
+;; Nukta for matra and presentation forms
(generator
(0
(cond
(" ([^ ]+) "
- (1 otf:knda=blwf,abvs,blws,psts+abvm,blwm,dist))
+ | (1 :otf=knda=nukt,pres,abvs,blws,psts,haln+) |)
+
+ ("." =))
+ *))
- ("."
- [ = ]))
+;; Stage 7
+;; Remove ZWNJ/ZWJ
+(generator
+ (0
+ (cond
+ ("[NJ]")
+
+ ("." =))
+ *))
+
+;; Stage 8
+;; GPOS processing
+(generator
+ (0
+ (cond
+ (" ([^ ]+) "
+ (1 :otf=knda=+abvm,blwm,dist))
+
+ ("." =))
*))
-;; Copyright (C) 2004, 2007
+;; Copyright (C) 2004, 2007, 2010
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; TAML-OTF.flt -- Font Layout Table for Tamil OpenType fonts
-;; Copyright (C) 2004, 2006, 2007 AIST (H15PRO112)
+;; Copyright (C) 2004, 2006, 2007, 2010 AIST (H15PRO112)
;; See the end for copying conditions.
(font layouter taml-otf nil
- (font (nil nil unicode-bmp :otf=taml=akhn)))
+ (version "1.6.0")
+ (font (nil nil unicode-bmp :otf=taml)))
;;; <li> TAML-OTF.flt
;;;
;;; For Tamil OpenType fonts to draw the Tamil script.
(category
+ ;; X: generic
+ ;; a: ANUSVARA
+ ;; V: independent vowel
;; C: consonant
;; H: HALANT
;; m: vowel sign (pre)
- ;; u: vowel sign (above)
- ;; b: vowel sign (below)
- ;; p: vowel sign (post)
- ;; X: generic
+ ;; p: vowel sign (others)
(0x0B80 0x0BFF ?X) ; generic
+ (0x0B82 ?a) ; SIGN ANUSVARA
+ (0x0B85 0x0B94 ?V) ; LETTER A .. AU
(0x0B95 0x0BB9 ?C) ; LETTER KA .. HA
- (0x0BBE 0x0BBF ?p) ; VOWEL SIGN AA .. I
- (0x0BC0 ?u) ; VOWEL SIGN II
- (0x0BC1 0x0BC2 ?b) ; VOWEL SIGN U .. UU
+ (0x0BBE 0x0BC2 ?p) ; VOWEL SIGN AA .. I
(0x0BC6 0x0BC8 ?m) ; VOWEL SIGN E .. AI
(0x0BCD ?H) ; SIGN VIRAMA
(0x0BD7 ?p) ; AU LENGTH MARK
- (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
+
(0x200C ?N) ; ZWNJ
+ (0x200D ?J) ; ZWJ
+ (0x25CC ?X) ; DOTTED CIRCLE
)
-;; Preprocessing.
+;; Stage 0
+;; Preprocessing
(generator
(0
(cond
0x0BC7 0x0BBE)
((0x0BCC)
0x0BC6 0x0BD7)
+
;; A variation of AU.
((0x0B92 0x0BD7)
0x0B94)
- ;; TAMu and TSCu fonts generate the SRI ligature with 'akhn'.
- ;; (lohit and latha do it with 'half' + 'abvs'.)
+
+ ;; The SHRII ligature and its old definition
+ ((0x0BB6 0x0BCD 0x0BB0 0x0BC0)
+ (0 :otf=taml=akhn,half,pres,abvs,blws,psts,haln+))
((0x0BB8 0x0BCD 0x0BB0 0x0BC0)
- otf:taml=akhn+)
+ (0 :otf=taml=akhn,half,pres,abvs,blws,psts,haln+))
+
("." =))
*))
-;; Syllable identification.
+;; Stage 1
+;; Syllable identification
(generator
(0
(cond
- ;; A syllable with vowel signs.
- ("((CH)*C)(mp?|b|u|p)"
- < | (1 otf:taml=akhn,half+) (3 = *) | >)
+ ;; Consonant-based syllables
+ ;;1 23 4
+ ("(C((J?H|HJ?)C)*)(H[NJ]?|m?p?a?)"
+ < |
+ (cond
+ (".+HJ$" :otf=taml=nukt,akhn+)
+ ("(.+)(H)N?$" (1 :otf=taml=nukt,akhn+) (2 =) 0x200C)
+ (".+" :otf=taml=nukt,akhn+))
+ | >)
+
+ ;; Syllables with an independent vowel
+ ("Vm?p?a?"
+ < | = * | >)
- ;; No vowel signs.
- ("((CH)*C)(HN?)?"
- < | (1 otf:taml=akhn,half+) (3 =) | >)
+ ;; Two-part vowel signs
+ ((0x0BC6 0x0BBE)
+ (cond
+ ((font-facility 0x25CC) < = 0x25CC = >)
+ (".+" [ 0x0BCA ])))
+ ((0x0BC7 0x0BBE)
+ (cond
+ ((font-facility 0x25CC) < = 0x25CC = >)
+ (".+" [ 0x0BCB ])))
+ ((0x0BC6 0x0BD7)
+ (cond
+ ((font-facility 0x25CC) < = 0x25CC = >)
+ (".+" [ 0x0BCC ])))
+
+ ;; Combining marks are displayed with a DOTTED CIRCLE.
+ ("m"
+ (cond
+ ((font-facility 0x25CC) < = 0x25CC >)
+ ("." [ = ])))
+ ("[Hpa]"
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = >)
+ ("." [ = ])))
("." =))
*))
-;; Move Matra before the base consonant.
+;; Stage 2
+;; Move pre-base matra after the last halant, or to the beginning
(generator
(0
(cond
- (" ([^ m]*)([^ m])(m)(p)? "
- | (1 = *) (3 =) (2 =) (4 =) |)
+ ;; 1 2 3 4
+ (" ([^ ]+HJ?)([^H ]+)(m)([^ ]*) "
+ | (1 = *) (3 =) (2 = *) (4 = *) |)
+
+ ;; 1 2 3
+ (" ([^ ]+)(m)([^ ]*) "
+ | (2 =) (1 = *) (3 = *) |)
+
("." =))
*))
-;; Apply other OTF features.
+;; Stage 3
+;; Presentation forms
(generator
(0
(cond
(" ([^ ]+) "
- (1 otf:taml=pres,abvs,blws,psts,haln+abvm,blwm,dist))
- ("."
- [ = ]))
+ | (1 :otf=taml=pres,abvs,blws,psts,haln+) |)
+
+ ("." =))
+ *))
+
+;; Stage 4
+;; Remove ZWNJ/ZWJ
+(generator
+ (0
+ (cond
+ ("[NJ]")
+
+ ("." =))
+ *))
+
+;; Stage 5
+;; GPOS processing
+(generator
+ (0
+ (cond
+ (" ([^ ]+) "
+ (1 :otf=taml=+abvm,blwm,dist))
+
+ ("." =))
*))
-;; Copyright (C) 2004, 2006, 2007
+;; Copyright (C) 2004, 2006, 2007, 2010
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; TELU-OTF.flt -- Font Layout Table for Telugu OpenType fonts
-;; Copyright (C) 2004, 2007, 2008 AIST (H15PRO112)
+;; Copyright (C) 2004, 2007, 2008, 2010 AIST (H15PRO112)
;; See the end for copying conditions.
(font layouter telu-otf nil
- (font (nil nil unicode-bmp :otf=telu=blwf)))
+ (version "1.6.0")
+ (font (nil nil unicode-bmp :otf=telu)))
;;; <li> TELU-OTF.flt
;;;
;;; For Telugu OpenType fonts to draw the Telugu script.
(category
- ;; C: consonant
- ;; H: HALANT
- ;; u: vowel sign (above)
- ;; p: vowel sign (post)
- ;; b: vowel sign (below)
- ;; a: vowel modifier (post)
- ;; V: independent vowel
- ;; N: ZWNJ (ZERO WIDTH NON-JOINER)
- ;; J: ZWJ (ZERO WIDTH JOINER)
- ;; X: generic
- (0x0C00 0x0C7F ?E) ; generic
- (0x0C01 0x0C03 ?a) ; SIGN CANDRABINDU .. VISARGA
+ (0x0C00 0x0C7F ?X) ; generic
+ (0x0C01 0x0C03 ?A) ; SIGN CANDRABINDU .. VISARGA
(0x0C05 0x0C14 ?V) ; LETTER A .. AU
(0x0C15 0x0C39 ?C) ; LETTER KA .. HA
- (0x0C3E 0x0C40 ?u) ; VOWEL SIGN AA .. II
- (0x0C41 0x0C44 ?p) ; VOWEL SIGN U .. VOCALIC RR
+ (0x0C3E 0x0C42 ?u) ; VOWEL SIGN AA .. II
+ (0x0C43 0x0C44 ?p) ; VOWEL SIGN U .. VOCALIC RR
(0x0C46 0x0C47 ?u) ; VOWEL SIGN E .. EE
(0x0C4A 0x0C4C ?u) ; VOWEL SIGN O .. AU
(0x0C4D ?H) ; SIGN VIRAMA
(0x0C56 ?b) ; AI LENGTH MARK
(0x0C58 0x0C59 ?C) ; LETTER TSA .. DZA
(0x0C60 0x0C61 ?V) ; LETTER VOCALIC RR .. VOCALIC LL
- (0x0C62 0x0C63 ?b) ; VOWEL SIGN VOCALIC L .. LL
- (0x0964 0x0965 ?X) ; DANDA .. DOUBLE DANDA
+ (0x0C62 0x0C63 ?b) ; VOWEL SIGN VOCALIC L .. VOCALIC LL
+
(0x200C ?N) ; ZWNJ
(0x200D ?J) ; ZWJ
+ (0x25CC ?X) ; DOTTED CIRCLE
+
+ (blwf ?B)
)
-;; Decompose two-part vowels.
+;; Stage 0
+;; Preprocessing
(generator
(0
(cond
+ ;; Decompose two-part vowel signs.
((0x0C48)
0x0C46 0x0C56)
+
+ ("." =))
+ *))
+
+;; Stage 1
+;; Syllable identification
+(generator
+ (0
+ (cond
+ ;; Consonant-based syllables
+ ;;1 23 4
+ ("(C((J?H|HJ?)C)*)(H[NJ]?|u?b?p?A?)"
+ < |
+ (cond
+ (".+HJ$" :otf=telu=nukt,akhn+)
+ ("(.+)(H)N?$" (1 :otf=telu=nukt,akhn+) (2 =) 0x200C)
+ (".+" :otf=telu=nukt,akhn+))
+ | >)
+
+ ;; Syllables with an independent vowel
+ ;;1 2 3
+ ("(V)(J?HC)?(u?b?p?A?)"
+ < | (1 =) (2 :otf=telu=blwf+) (3 = *) | >)
+
+ ;; Two-part vowel signs
+ ((0x0C46 0x0C56)
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = = >)
+ (".+" [ 0x0C48 ])))
+
+ ;; Combining marks are displayed with a DOTTED CIRCLE.
+ ("[HubpA]"
+ (cond
+ ((font-facility 0x25CC) < 0x25CC = >)
+ ("." [ = ])))
+
+ ;; Isolated blwf is displayed with a DOTTED CIRCLE in the
+ ;; next stage.
+ ("(J)(H)(C)"
+ < | (1 =) (3 =) (2 = ) | >)
+
("." =))
*))
-;; Syllable identification and reordering. The base consonant is
-;; always the first one, because all Telugu consonants have a below
-;; form.
+;; Stage 2
+;; Reorder halant for blwf
(generator
(0
(cond
- ;; A syllable with a vowel sign.
- ;;1 23 4 5
- ("(C)((HC)*)(ub?|p)(a)?"
- < | (1 =) (2 move-h) (4 = *) (5 =) | >)
-
- ;; A syllable with a vowel modifier.
- ;;1 23 4
- ("(C)((HC)*)(a)"
- < | (1 =) (2 move-h) (4 =) | >)
-
- ;; No vowel signs, no vowel modifiers. If the syllable ends with a
- ;; Halant, cancel the Halant movement.
- ;;1 23 4
- ("(C)((HC)*)(HN?)?"
- < | (1 =) (4 0x0C4D) (2 move-h) | >)
-
- ;; A syllable starting with an independent vowel.
- ("Va?"
- < | = * | >)
+ ;; Isolated blwf
+ (" J(CH) "
+ (cond
+ ((font-facility 0x25CC) < 0x25CC (1 :otf=telu=blwf+) >)
+ (" J(CH) " [ (1 :otf=telu=blwf+) ])))
+
+ ;; Syllables with an overt halant
+ (" ([^ ]+)(HN) "
+ | (1 reorder *) (2 = =) |)
+
+ ;; Ordinary syllables
+ (" ([^ubpA ]+)(u?b?p?A?) "
+ | (1 reorder *) (2 = *) |)
("." =))
*)
- (move-h
+ (reorder
(cond
- ("(H)(.+)"
- (2 = *) (1 =)))))
+ ("J?(H)(C)"
+ (2 =) (1 =))
+ ("." =)))
+ )
+
+;; Stage 3
+;; Language forms
+;; Although all consonants have a blow form and none has a half form,
+;; we have to prevent the first consonant from forming the below form.
+(generator
+ (0
+ (cond
+ ;; Overt halant forms
+ (" ([^ ]+)(HN) "
+ |
+ (1 (cond ("(.H)J?(.*)" (1 :otf=telu=half+) (2 lang-forms *))
+ (".+" lang-forms *)))
+ (2 = =) |)
+
+ ;; Other syllables
+ (" ([^ubpA ]*)(u?b?p?A?) "
+ |
+ (1 (cond ("(.H)J?(.*)" (1 :otf=telu=half+) (2 lang-forms *))
+ (".+" lang-forms *)))
+ (2 = *) |)
+
+ ("." =))
+ *)
+
+ (lang-forms
+ (cond
+ ("(.H)J" (1 :otf=telu=half+))
+ (".H" :otf=telu=blwf,half+)
+ ("." =)))
+ )
-;; Apply OTF features. In case of Telugu, 'akhn' is applied after
-;; reordering.
+;; Stage 4
+;; Move subscript glyphs
(generator
(0
(cond
- ;; A syllable that ends with a Halant.
- (" (CH)([^ ]*) "
- (1 otf:telu=haln+) (2 otf:telu=akhn,blwf,abvs,blws,psts+abvm,blwm,dist))
+ (" ([^B ]*[^BJ])J?(B*)(ub?|b)([^ ]*) "
+ | (1 = *) (3 = *) (2 = *) (4 = *) |)
- ;; Ordinary syllables.
+ ("." =))
+ *))
+
+;; Stage 5
+;; Presentation forms
+(generator
+ (0
+ (cond
+ (" ([^ ]+) "
+ | (1 :otf=telu=pres,abvs,blws,psts,haln+) |)
+
+ ("." =))
+ *))
+
+;; Stage 6
+;; Remove ZWNJ/ZWJ
+(generator
+ (0
+ (cond
+ ("[NJ]")
+
+ ("." =))
+ *))
+
+;; Stage 7
+;; GPOS processing
+(generator
+ (0
+ (cond
(" ([^ ]+) "
- (1 otf:telu=akhn,blwf,abvs,blws,psts+absm,blwm,dist))
+ (1 :otf=telu=+abvm,blwm,dist))
- ("."
- [ = ]))
+ ("." =))
*))
-;; Copyright (C) 2004, 2007, 2008
+;; Copyright (C) 2004, 2007, 2008, 2010
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112