Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic-private.hh

Issue 396393005: Roll HarfBuzz to 0.9.32 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for include order presubmit issue Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 OT_C = 1, 46 OT_C = 1,
47 OT_V = 2, 47 OT_V = 2,
48 OT_N = 3, 48 OT_N = 3,
49 OT_H = 4, 49 OT_H = 4,
50 OT_ZWNJ = 5, 50 OT_ZWNJ = 5,
51 OT_ZWJ = 6, 51 OT_ZWJ = 6,
52 OT_M = 7, 52 OT_M = 7,
53 OT_SM = 8, 53 OT_SM = 8,
54 OT_VD = 9, 54 OT_VD = 9,
55 OT_A = 10, 55 OT_A = 10,
56 OT_NBSP = 11, 56 OT_PLACEHOLDER = 11,
57 OT_DOTTEDCIRCLE = 12, 57 OT_DOTTEDCIRCLE = 12,
58 OT_RS = 13, /* Register Shifter, used in Khmer OT spec. */ 58 OT_RS = 13, /* Register Shifter, used in Khmer OT spec. */
59 OT_Coeng = 14, /* Khmer-style Virama. */ 59 OT_Coeng = 14, /* Khmer-style Virama. */
60 OT_Repha = 15, /* Atomically-encoded logical or visual repha. */ 60 OT_Repha = 15, /* Atomically-encoded logical or visual repha. */
61 OT_Ra = 16, 61 OT_Ra = 16,
62 OT_CM = 17, /* Consonant-Medial. */ 62 OT_CM = 17, /* Consonant-Medial. */
63 OT_Avag = 18, /* Avagraha. */ 63 OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */
64 OT_CM2 = 31 /* Consonant-Medial, second slot. */ 64 OT_CM2 = 31 /* Consonant-Medial, second slot. */
65 }; 65 };
66 66
67 #define MEDIAL_FLAGS (FLAG (OT_CM) | FLAG (OT_CM2))
68
69 /* Note:
70 *
71 * We treat Vowels and placeholders as if they were consonants. This is safe be cause Vowels
72 * cannot happen in a consonant syllable. The plus side however is, we can call the
73 * consonant syllable logic from the vowel syllable function and get it all righ t! */
74 #define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
75 #define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
76 #define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
77
78
67 /* Visual positions in a syllable from left to right. */ 79 /* Visual positions in a syllable from left to right. */
68 enum indic_position_t { 80 enum indic_position_t {
69 POS_START, 81 POS_START,
70 82
71 POS_RA_TO_BECOME_REPH, 83 POS_RA_TO_BECOME_REPH,
72 POS_PRE_M, 84 POS_PRE_M,
73 POS_PRE_C, 85 POS_PRE_C,
74 86
75 POS_BASE_C, 87 POS_BASE_C,
76 POS_AFTER_MAIN, 88 POS_AFTER_MAIN,
77 89
78 POS_ABOVE_C, 90 POS_ABOVE_C,
79 91
80 POS_BEFORE_SUB, 92 POS_BEFORE_SUB,
81 POS_BELOW_C, 93 POS_BELOW_C,
82 POS_AFTER_SUB, 94 POS_AFTER_SUB,
83 95
84 POS_BEFORE_POST, 96 POS_BEFORE_POST,
85 POS_POST_C, 97 POS_POST_C,
86 POS_AFTER_POST, 98 POS_AFTER_POST,
87 99
88 POS_FINAL_C, 100 POS_FINAL_C,
89 POS_SMVD, 101 POS_SMVD,
90 102
91 POS_END 103 POS_END
92 }; 104 };
93 105
94 /* Categories used in IndicSyllabicCategory.txt from UCD. */ 106 /* Categories used in IndicSyllabicCategory.txt from UCD. */
95 enum indic_syllabic_category_t { 107 enum indic_syllabic_category_t {
96 INDIC_SYLLABIC_CATEGORY_OTHER»» » = OT_X, 108 INDIC_SYLLABIC_CATEGORY_OTHER»» » » = OT_X,
97 109
98 INDIC_SYLLABIC_CATEGORY_AVAGRAHA» » = OT_Avag, 110 INDIC_SYLLABIC_CATEGORY_AVAGRAHA» » » = OT_Symbol,
99 INDIC_SYLLABIC_CATEGORY_BINDU»» » = OT_SM, 111 INDIC_SYLLABIC_CATEGORY_BINDU»» » » = OT_SM,
100 INDIC_SYLLABIC_CATEGORY_CONSONANT» » = OT_C, 112 INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER»» = OT_PLACEHOLDER, /* TOD O */
101 INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD» = OT_C, 113 INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK» » = OT_A,
102 INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL» = OT_CM, 114 INDIC_SYLLABIC_CATEGORY_CONSONANT» » » = OT_C,
103 INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER»= OT_C, 115 INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD» » = OT_C,
104 INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL» = OT_CM, 116 INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL» » = OT_CM,
105 INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER»= OT_NBSP, 117 INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER»» = OT_C,
106 INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED» = OT_CM, 118 INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL» » = OT_CM,
107 INDIC_SYLLABIC_CATEGORY_CONSONANT_REPHA» = OT_Repha, 119 INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER»» = OT_PLACEHOLDER,
108 INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER» = OT_X, 120 INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA» = OT_Repha,
109 INDIC_SYLLABIC_CATEGORY_NUKTA»» » = OT_N, 121 INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED» » = OT_CM,
110 INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER» = OT_RS, 122 INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA» = OT_N,
111 INDIC_SYLLABIC_CATEGORY_TONE_LETTER» » = OT_X, 123 INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK» » = OT_SM,
112 INDIC_SYLLABIC_CATEGORY_TONE_MARK» » = OT_N, 124 INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER» » = OT_H, /* TODO */
113 INDIC_SYLLABIC_CATEGORY_VIRAMA» » = OT_H, 125 INDIC_SYLLABIC_CATEGORY_JOINER» » » = OT_ZWJ,
114 INDIC_SYLLABIC_CATEGORY_VISARGA» » = OT_SM, 126 INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER» » = OT_X,
115 INDIC_SYLLABIC_CATEGORY_VOWEL»» » = OT_V, 127 INDIC_SYLLABIC_CATEGORY_NON_JOINER» » » = OT_ZWNJ,
116 INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT» = OT_M, 128 INDIC_SYLLABIC_CATEGORY_NUKTA»» » » = OT_N,
117 INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT» = OT_V 129 INDIC_SYLLABIC_CATEGORY_NUMBER» » » = OT_PLACEHOLDER,
130 INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER»» » = OT_PLACEHOLDER, /* TOD O */
131 INDIC_SYLLABIC_CATEGORY_PURE_KILLER» » » = OT_H, /* TODO */
132 INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER» » = OT_RS,
133 INDIC_SYLLABIC_CATEGORY_TONE_LETTER» » » = OT_X,
134 INDIC_SYLLABIC_CATEGORY_TONE_MARK» » » = OT_N,
135 INDIC_SYLLABIC_CATEGORY_VIRAMA» » » = OT_H,
136 INDIC_SYLLABIC_CATEGORY_VISARGA» » » = OT_SM,
137 INDIC_SYLLABIC_CATEGORY_VOWEL»» » » = OT_V,
138 INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT» » = OT_M,
139 INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT» » = OT_V
118 }; 140 };
119 141
120 /* Categories used in IndicSMatraCategory.txt from UCD */ 142 /* Categories used in IndicSMatraCategory.txt from UCD */
121 enum indic_matra_category_t { 143 enum indic_matra_category_t {
122 INDIC_MATRA_CATEGORY_NOT_APPLICABLE» » = POS_END, 144 INDIC_MATRA_CATEGORY_NOT_APPLICABLE» » » = POS_END,
123 145
124 INDIC_MATRA_CATEGORY_LEFT» » » = POS_PRE_C, 146 INDIC_MATRA_CATEGORY_LEFT» » » » = POS_PRE_C,
125 INDIC_MATRA_CATEGORY_TOP» » » = POS_ABOVE_C, 147 INDIC_MATRA_CATEGORY_TOP» » » » = POS_ABOVE_C,
126 INDIC_MATRA_CATEGORY_BOTTOM» » » = POS_BELOW_C, 148 INDIC_MATRA_CATEGORY_BOTTOM» » » » = POS_BELOW_C,
127 INDIC_MATRA_CATEGORY_RIGHT» » » = POS_POST_C, 149 INDIC_MATRA_CATEGORY_RIGHT» » » » = POS_POST_C,
128 150
129 /* These should resolve to the position of the last part of the split sequence . */ 151 /* These should resolve to the position of the last part of the split sequence . */
130 INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT»» = INDIC_MATRA_CATEGORY_RIGHT, 152 INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT»» » = INDIC_MATRA_CATEGORY_R IGHT,
131 INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT» » = INDIC_MATRA_CATEGORY_RIGHT, 153 INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT» » » = INDIC_MATRA_CATEGORY_R IGHT,
132 INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM» » = INDIC_MATRA_CATEGORY_BOTTOM, 154 INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM» » » = INDIC_MATRA_CATEGORY_B OTTOM,
133 INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT»= INDIC_MATRA_CATEGORY_RIGHT, 155 INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT»» = INDIC_MATRA_CATEGORY_R IGHT,
134 INDIC_MATRA_CATEGORY_TOP_AND_LEFT» » = INDIC_MATRA_CATEGORY_TOP, 156 INDIC_MATRA_CATEGORY_TOP_AND_LEFT» » » = INDIC_MATRA_CATEGORY_T OP,
135 INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT» = INDIC_MATRA_CATEGORY_RIGHT, 157 INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT» » = INDIC_MATRA_CATEGORY_R IGHT,
136 INDIC_MATRA_CATEGORY_TOP_AND_RIGHT» » = INDIC_MATRA_CATEGORY_RIGHT, 158 INDIC_MATRA_CATEGORY_TOP_AND_RIGHT» » » = INDIC_MATRA_CATEGORY_R IGHT,
137 159
138 INDIC_MATRA_CATEGORY_INVISIBLE» » = INDIC_MATRA_CATEGORY_NOT_APPLI CABLE, 160 INDIC_MATRA_CATEGORY_OVERSTRUCK» » » = POS_AFTER_MAIN,
139 INDIC_MATRA_CATEGORY_OVERSTRUCK» » = POS_AFTER_MAIN, 161 INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT» » = POS_PRE_M
140 INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT» = POS_PRE_M
141 }; 162 };
142 163
143 /* Note: We use ASSERT_STATIC_EXPR_ZERO() instead of ASSERT_STATIC_EXPR() and th e comma operation 164 /* Note: We use ASSERT_STATIC_EXPR_ZERO() instead of ASSERT_STATIC_EXPR() and th e comma operation
144 * because gcc fails to optimize the latter and fills the table in at runtime. * / 165 * because gcc fails to optimize the latter and fills the table in at runtime. * /
145 #define INDIC_COMBINE_CATEGORIES(S,M) \ 166 #define INDIC_COMBINE_CATEGORIES(S,M) \
146 (ASSERT_STATIC_EXPR_ZERO (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || (S == IN DIC_SYLLABIC_CATEGORY_VIRAMA || S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT)) + \ 167 (ASSERT_STATIC_EXPR_ZERO (M == INDIC_MATRA_CATEGORY_NOT_APPLICABLE || \
168 » » » ( \
169 » » » S == INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL || \
170 » » » S == INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK || \
171 » » » S == INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER || \
172 » » » S == INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_R EPHA || \
173 » » » S == INDIC_SYLLABIC_CATEGORY_VIRAMA || \
174 » » » S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT || \
175 » » » false)) + \
147 ASSERT_STATIC_EXPR_ZERO (S < 255 && M < 255) + \ 176 ASSERT_STATIC_EXPR_ZERO (S < 255 && M < 255) + \
148 ((M << 8) | S)) 177 ((M << 8) | S))
149 178
150 HB_INTERNAL INDIC_TABLE_ELEMENT_TYPE 179 HB_INTERNAL INDIC_TABLE_ELEMENT_TYPE
151 hb_indic_get_categories (hb_codepoint_t u); 180 hb_indic_get_categories (hb_codepoint_t u);
152 181
153 #endif /* HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH */ 182 #endif /* HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698