OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2012 Google, Inc. | 2 * Copyright © 2012 Google, Inc. |
3 * | 3 * |
4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
5 * | 5 * |
6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
10 * all copies of this software. | 10 * all copies of this software. |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #define INDIC_TABLE_ELEMENT_TYPE uint16_t | 37 #define INDIC_TABLE_ELEMENT_TYPE uint16_t |
38 | 38 |
39 /* Cateories used in the OpenType spec: | 39 /* Cateories used in the OpenType spec: |
40 * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx | 40 * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx |
41 */ | 41 */ |
42 /* Note: This enum is duplicated in the -machine.rl source file. | 42 /* Note: This enum is duplicated in the -machine.rl source file. |
43 * Not sure how to avoid duplication. */ | 43 * Not sure how to avoid duplication. */ |
44 enum indic_category_t { | 44 enum indic_category_t { |
45 OT_X = 0, | 45 OT_X = 0, |
46 OT_C, | 46 OT_C = 1, |
47 OT_V, | 47 OT_V = 2, |
48 OT_N, | 48 OT_N = 3, |
49 OT_H, | 49 OT_H = 4, |
50 OT_ZWNJ, | 50 OT_ZWNJ = 5, |
51 OT_ZWJ, | 51 OT_ZWJ = 6, |
52 OT_M, | 52 OT_M = 7, |
53 OT_SM, | 53 OT_SM = 8, |
54 OT_VD, | 54 OT_VD = 9, |
55 OT_A, | 55 OT_A = 10, |
56 OT_NBSP, | 56 OT_NBSP = 11, |
57 OT_DOTTEDCIRCLE, /* Not in the spec, but special in Uniscribe. /Very very/ spe
cial! */ | 57 OT_DOTTEDCIRCLE = 12, |
58 OT_RS, /* Register Shifter, used in Khmer OT spec */ | 58 OT_RS = 13, /* Register Shifter, used in Khmer OT spec. */ |
59 OT_Coeng, | 59 OT_Coeng = 14, /* Khmer-style Virama. */ |
60 OT_Repha, | 60 OT_Repha = 15, /* Atomically-encoded logical or visual repha. */ |
61 OT_Ra, /* Not explicitly listed in the OT spec, but used in the grammar. */ | 61 OT_Ra = 16, |
62 OT_CM | 62 OT_CM = 17, /* Consonant-Medial. */ |
| 63 OT_Avag = 18, /* Avagraha. */ |
| 64 OT_CM2 = 31 /* Consonant-Medial, second slot. */ |
63 }; | 65 }; |
64 | 66 |
65 /* Visual positions in a syllable from left to right. */ | 67 /* Visual positions in a syllable from left to right. */ |
66 enum indic_position_t { | 68 enum indic_position_t { |
67 POS_START, | 69 POS_START, |
68 | 70 |
69 POS_RA_TO_BECOME_REPH, | 71 POS_RA_TO_BECOME_REPH, |
70 POS_PRE_M, | 72 POS_PRE_M, |
71 POS_PRE_C, | 73 POS_PRE_C, |
72 | 74 |
(...skipping 13 matching lines...) Expand all Loading... |
86 POS_FINAL_C, | 88 POS_FINAL_C, |
87 POS_SMVD, | 89 POS_SMVD, |
88 | 90 |
89 POS_END | 91 POS_END |
90 }; | 92 }; |
91 | 93 |
92 /* Categories used in IndicSyllabicCategory.txt from UCD. */ | 94 /* Categories used in IndicSyllabicCategory.txt from UCD. */ |
93 enum indic_syllabic_category_t { | 95 enum indic_syllabic_category_t { |
94 INDIC_SYLLABIC_CATEGORY_OTHER = OT_X, | 96 INDIC_SYLLABIC_CATEGORY_OTHER = OT_X, |
95 | 97 |
96 INDIC_SYLLABIC_CATEGORY_AVAGRAHA» » = OT_X, | 98 INDIC_SYLLABIC_CATEGORY_AVAGRAHA» » = OT_Avag, |
97 INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM, | 99 INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM, |
98 INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C, | 100 INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C, |
99 INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C, | 101 INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C, |
100 INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_CM, | 102 INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_CM, |
101 INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = OT_C, | 103 INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = OT_C, |
102 INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL = OT_CM, | 104 INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL = OT_CM, |
103 INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_NBSP, | 105 INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_NBSP, |
104 INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED» = OT_C, | 106 INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED» = OT_CM, |
105 INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_Repha, | 107 INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA = OT_Repha, |
106 INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_X, | 108 INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_X, |
107 INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N, | 109 INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N, |
108 INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_RS, | 110 INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_RS, |
109 INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, | 111 INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, |
110 INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_N, | 112 INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_N, |
111 INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, | 113 INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, |
112 INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM, | 114 INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM, |
113 INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V, | 115 INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V, |
114 INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M, | 116 INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M, |
(...skipping 27 matching lines...) Expand all Loading... |
142 * because gcc fails to optimize the latter and fills the table in at runtime. *
/ | 144 * because gcc fails to optimize the latter and fills the table in at runtime. *
/ |
143 #define INDIC_COMBINE_CATEGORIES(S,M) \ | 145 #define INDIC_COMBINE_CATEGORIES(S,M) \ |
144 (ASSERT_STATIC_EXPR_ZERO (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || (S == IN
DIC_SYLLABIC_CATEGORY_VIRAMA || S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT)) +
\ | 146 (ASSERT_STATIC_EXPR_ZERO (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || (S == IN
DIC_SYLLABIC_CATEGORY_VIRAMA || S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT)) +
\ |
145 ASSERT_STATIC_EXPR_ZERO (S < 255 && M < 255) + \ | 147 ASSERT_STATIC_EXPR_ZERO (S < 255 && M < 255) + \ |
146 ((M << 8) | S)) | 148 ((M << 8) | S)) |
147 | 149 |
148 HB_INTERNAL INDIC_TABLE_ELEMENT_TYPE | 150 HB_INTERNAL INDIC_TABLE_ELEMENT_TYPE |
149 hb_indic_get_categories (hb_codepoint_t u); | 151 hb_indic_get_categories (hb_codepoint_t u); |
150 | 152 |
151 #endif /* HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH */ | 153 #endif /* HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH */ |
OLD | NEW |