1 | |
2 | #line 1 "hb-buffer-deserialize-text-glyphs.rl" |
3 | /* |
4 | * Copyright © 2013 Google, Inc. |
5 | * |
6 | * This is part of HarfBuzz, a text shaping library. |
7 | * |
8 | * Permission is hereby granted, without written agreement and without |
9 | * license or royalty fees, to use, copy, modify, and distribute this |
10 | * software and its documentation for any purpose, provided that the |
11 | * above copyright notice and the following two paragraphs appear in |
12 | * all copies of this software. |
13 | * |
14 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
15 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
16 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
17 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
18 | * DAMAGE. |
19 | * |
20 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
21 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
22 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
23 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
24 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
25 | * |
26 | * Google Author(s): Behdad Esfahbod |
27 | */ |
28 | |
29 | #ifndef HB_BUFFER_DESERIALIZE_TEXT_GLYPHS_HH |
30 | #define HB_BUFFER_DESERIALIZE_TEXT_GLYPHS_HH |
31 | |
32 | #include "hb.hh" |
33 | |
34 | |
35 | #line 33 "hb-buffer-deserialize-text-glyphs.hh" |
36 | static const unsigned char _deserialize_text_glyphs_trans_keys[] = { |
37 | 0u, 0u, 48u, 57u, 45u, 57u, 48u, 57u, 45u, 57u, 48u, 57u, 48u, 57u, 45u, 57u, |
38 | 48u, 57u, 44u, 44u, 45u, 57u, 48u, 57u, 44u, 57u, 43u, 124u, 9u, 124u, 9u, 124u, |
39 | 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, 9u, 124u, |
40 | 9u, 124u, 9u, 124u, 9u, 124u, 0 |
41 | }; |
42 | |
43 | static const char _deserialize_text_glyphs_key_spans[] = { |
44 | 0, 10, 13, 10, 13, 10, 10, 13, |
45 | 10, 1, 13, 10, 14, 82, 116, 116, |
46 | 116, 116, 116, 116, 116, 116, 116, 116, |
47 | 116, 116, 116 |
48 | }; |
49 | |
50 | static const short _deserialize_text_glyphs_index_offsets[] = { |
51 | 0, 0, 11, 25, 36, 50, 61, 72, |
52 | 86, 97, 99, 113, 124, 139, 222, 339, |
53 | 456, 573, 690, 807, 924, 1041, 1158, 1275, |
54 | 1392, 1509, 1626 |
55 | }; |
56 | |
57 | static const char _deserialize_text_glyphs_indicies[] = { |
58 | 0, 2, 2, 2, 2, 2, 2, |
59 | 2, 2, 2, 1, 3, 1, 1, 4, |
60 | 5, 5, 5, 5, 5, 5, 5, 5, |
61 | 5, 1, 6, 7, 7, 7, 7, 7, |
62 | 7, 7, 7, 7, 1, 8, 1, 1, |
63 | 9, 10, 10, 10, 10, 10, 10, 10, |
64 | 10, 10, 1, 11, 12, 12, 12, 12, |
65 | 12, 12, 12, 12, 12, 1, 13, 14, |
66 | 14, 14, 14, 14, 14, 14, 14, 14, |
67 | 1, 15, 1, 1, 16, 17, 17, 17, |
68 | 17, 17, 17, 17, 17, 17, 1, 18, |
69 | 19, 19, 19, 19, 19, 19, 19, 19, |
70 | 19, 1, 20, 1, 21, 1, 1, 22, |
71 | 23, 23, 23, 23, 23, 23, 23, 23, |
72 | 23, 1, 24, 25, 25, 25, 25, 25, |
73 | 25, 25, 25, 25, 1, 20, 1, 1, |
74 | 1, 19, 19, 19, 19, 19, 19, 19, |
75 | 19, 19, 19, 1, 26, 26, 1, 1, |
76 | 1, 1, 1, 1, 1, 1, 1, 1, |
77 | 1, 1, 1, 1, 1, 1, 26, 1, |
78 | 1, 26, 1, 1, 1, 1, 1, 1, |
79 | 1, 1, 1, 1, 1, 1, 1, 1, |
80 | 1, 1, 1, 1, 1, 1, 1, 1, |
81 | 1, 1, 1, 1, 1, 26, 26, 1, |
82 | 1, 1, 1, 1, 1, 1, 1, 1, |
83 | 1, 1, 1, 1, 1, 1, 1, 1, |
84 | 1, 1, 1, 1, 1, 1, 1, 1, |
85 | 1, 1, 1, 1, 1, 26, 1, 28, |
86 | 28, 28, 28, 28, 27, 27, 27, 27, |
87 | 27, 27, 27, 27, 27, 27, 27, 27, |
88 | 27, 27, 27, 27, 27, 27, 28, 27, |
89 | 27, 29, 27, 27, 27, 27, 27, 27, |
90 | 27, 30, 1, 27, 27, 27, 27, 27, |
91 | 27, 27, 27, 27, 27, 27, 27, 27, |
92 | 27, 27, 27, 31, 27, 27, 32, 27, |
93 | 27, 27, 27, 27, 27, 27, 27, 27, |
94 | 27, 27, 27, 27, 27, 27, 27, 27, |
95 | 27, 27, 27, 27, 27, 27, 27, 27, |
96 | 27, 27, 33, 1, 27, 27, 27, 27, |
97 | 27, 27, 27, 27, 27, 27, 27, 27, |
98 | 27, 27, 27, 27, 27, 27, 27, 27, |
99 | 27, 27, 27, 27, 27, 27, 27, 27, |
100 | 27, 27, 28, 27, 34, 34, 34, 34, |
101 | 34, 26, 26, 26, 26, 26, 26, 26, |
102 | 26, 26, 26, 26, 26, 26, 26, 26, |
103 | 26, 26, 26, 34, 26, 26, 35, 26, |
104 | 26, 26, 26, 26, 26, 26, 36, 1, |
105 | 26, 26, 26, 26, 26, 26, 26, 26, |
106 | 26, 26, 26, 26, 26, 26, 26, 26, |
107 | 37, 26, 26, 38, 26, 26, 26, 26, |
108 | 26, 26, 26, 26, 26, 26, 26, 26, |
109 | 26, 26, 26, 26, 26, 26, 26, 26, |
110 | 26, 26, 26, 26, 26, 26, 26, 39, |
111 | 1, 26, 26, 26, 26, 26, 26, 26, |
112 | 26, 26, 26, 26, 26, 26, 26, 26, |
113 | 26, 26, 26, 26, 26, 26, 26, 26, |
114 | 26, 26, 26, 26, 26, 26, 26, 40, |
115 | 26, 41, 41, 41, 41, 41, 1, 1, |
116 | 1, 1, 1, 1, 1, 1, 1, 1, |
117 | 1, 1, 1, 1, 1, 1, 1, 1, |
118 | 41, 1, 1, 1, 1, 1, 1, 1, |
119 | 1, 1, 1, 1, 1, 1, 1, 1, |
120 | 1, 1, 1, 1, 1, 1, 1, 1, |
121 | 1, 1, 1, 1, 1, 1, 1, 1, |
122 | 1, 1, 1, 1, 1, 1, 1, 1, |
123 | 1, 1, 1, 1, 1, 1, 1, 1, |
124 | 1, 1, 1, 1, 1, 1, 1, 1, |
125 | 1, 1, 1, 1, 1, 1, 1, 1, |
126 | 1, 1, 1, 1, 1, 1, 1, 1, |
127 | 1, 1, 1, 1, 1, 1, 1, 1, |
128 | 1, 1, 1, 1, 1, 1, 1, 1, |
129 | 1, 1, 1, 1, 42, 1, 43, 43, |
130 | 43, 43, 43, 1, 1, 1, 1, 1, |
131 | 1, 1, 1, 1, 1, 1, 1, 1, |
132 | 1, 1, 1, 1, 1, 43, 1, 1, |
133 | 1, 1, 1, 1, 1, 1, 1, 1, |
134 | 1, 1, 1, 1, 1, 1, 1, 1, |
135 | 1, 1, 1, 1, 1, 1, 1, 1, |
136 | 1, 1, 1, 1, 1, 1, 1, 1, |
137 | 1, 1, 1, 1, 1, 1, 1, 1, |
138 | 1, 1, 1, 1, 1, 1, 1, 1, |
139 | 1, 1, 1, 1, 1, 1, 1, 1, |
140 | 1, 1, 1, 1, 1, 1, 1, 1, |
141 | 1, 1, 1, 1, 1, 1, 1, 1, |
142 | 1, 1, 1, 1, 1, 1, 1, 1, |
143 | 1, 1, 1, 1, 1, 1, 1, 1, |
144 | 1, 44, 1, 41, 41, 41, 41, 41, |
145 | 1, 1, 1, 1, 1, 1, 1, 1, |
146 | 1, 1, 1, 1, 1, 1, 1, 1, |
147 | 1, 1, 41, 1, 1, 1, 1, 1, |
148 | 1, 1, 1, 1, 1, 1, 1, 1, |
149 | 1, 1, 45, 45, 45, 45, 45, 45, |
150 | 45, 45, 45, 45, 1, 1, 1, 1, |
151 | 1, 1, 1, 1, 1, 1, 1, 1, |
152 | 1, 1, 1, 1, 1, 1, 1, 1, |
153 | 1, 1, 1, 1, 1, 1, 1, 1, |
154 | 1, 1, 1, 1, 1, 1, 1, 1, |
155 | 1, 1, 1, 1, 1, 1, 1, 1, |
156 | 1, 1, 1, 1, 1, 1, 1, 1, |
157 | 1, 1, 1, 1, 1, 1, 1, 1, |
158 | 1, 1, 1, 1, 1, 1, 42, 1, |
159 | 46, 46, 46, 46, 46, 1, 1, 1, |
160 | 1, 1, 1, 1, 1, 1, 1, 1, |
161 | 1, 1, 1, 1, 1, 1, 1, 46, |
162 | 1, 1, 47, 1, 1, 1, 1, 1, |
163 | 1, 1, 1, 48, 1, 1, 1, 1, |
164 | 1, 1, 1, 1, 1, 1, 1, 1, |
165 | 1, 1, 1, 1, 1, 1, 1, 1, |
166 | 1, 1, 1, 1, 1, 1, 1, 1, |
167 | 1, 1, 1, 1, 1, 1, 1, 1, |
168 | 1, 1, 1, 1, 1, 1, 1, 1, |
169 | 1, 1, 1, 1, 1, 1, 1, 1, |
170 | 1, 1, 1, 1, 1, 1, 1, 1, |
171 | 1, 1, 1, 1, 1, 1, 1, 1, |
172 | 1, 1, 1, 1, 1, 1, 1, 1, |
173 | 1, 1, 1, 49, 1, 50, 50, 50, |
174 | 50, 50, 1, 1, 1, 1, 1, 1, |
175 | 1, 1, 1, 1, 1, 1, 1, 1, |
176 | 1, 1, 1, 1, 50, 1, 1, 51, |
177 | 1, 1, 1, 1, 1, 1, 1, 1, |
178 | 1, 1, 1, 1, 1, 1, 1, 1, |
179 | 1, 1, 1, 1, 1, 1, 1, 1, |
180 | 1, 1, 1, 1, 1, 1, 1, 1, |
181 | 1, 1, 1, 1, 1, 1, 1, 1, |
182 | 1, 1, 1, 1, 1, 1, 1, 1, |
183 | 1, 1, 1, 1, 1, 1, 1, 1, |
184 | 1, 1, 1, 1, 1, 1, 1, 1, |
185 | 1, 1, 1, 1, 1, 1, 1, 1, |
186 | 1, 1, 1, 1, 1, 1, 1, 1, |
187 | 1, 1, 1, 1, 1, 1, 1, 1, |
188 | 52, 1, 50, 50, 50, 50, 50, 1, |
189 | 1, 1, 1, 1, 1, 1, 1, 1, |
190 | 1, 1, 1, 1, 1, 1, 1, 1, |
191 | 1, 50, 1, 1, 51, 1, 1, 1, |
192 | 1, 1, 1, 1, 1, 1, 1, 1, |
193 | 1, 12, 12, 12, 12, 12, 12, 12, |
194 | 12, 12, 12, 1, 1, 1, 1, 1, |
195 | 1, 1, 1, 1, 1, 1, 1, 1, |
196 | 1, 1, 1, 1, 1, 1, 1, 1, |
197 | 1, 1, 1, 1, 1, 1, 1, 1, |
198 | 1, 1, 1, 1, 1, 1, 1, 1, |
199 | 1, 1, 1, 1, 1, 1, 1, 1, |
200 | 1, 1, 1, 1, 1, 1, 1, 1, |
201 | 1, 1, 1, 1, 1, 1, 1, 1, |
202 | 1, 1, 1, 1, 1, 52, 1, 46, |
203 | 46, 46, 46, 46, 1, 1, 1, 1, |
204 | 1, 1, 1, 1, 1, 1, 1, 1, |
205 | 1, 1, 1, 1, 1, 1, 46, 1, |
206 | 1, 47, 1, 1, 1, 1, 1, 1, |
207 | 1, 1, 48, 1, 1, 1, 7, 7, |
208 | 7, 7, 7, 7, 7, 7, 7, 7, |
209 | 1, 1, 1, 1, 1, 1, 1, 1, |
210 | 1, 1, 1, 1, 1, 1, 1, 1, |
211 | 1, 1, 1, 1, 1, 1, 1, 1, |
212 | 1, 1, 1, 1, 1, 1, 1, 1, |
213 | 1, 1, 1, 1, 1, 1, 1, 1, |
214 | 1, 1, 1, 1, 1, 1, 1, 1, |
215 | 1, 1, 1, 1, 1, 1, 1, 1, |
216 | 1, 1, 1, 1, 1, 1, 1, 1, |
217 | 1, 1, 49, 1, 53, 53, 53, 53, |
218 | 53, 1, 1, 1, 1, 1, 1, 1, |
219 | 1, 1, 1, 1, 1, 1, 1, 1, |
220 | 1, 1, 1, 53, 1, 1, 54, 1, |
221 | 1, 1, 1, 1, 1, 1, 55, 1, |
222 | 1, 1, 1, 1, 1, 1, 1, 1, |
223 | 1, 1, 1, 1, 1, 1, 1, 1, |
224 | 1, 1, 1, 56, 1, 1, 1, 1, |
225 | 1, 1, 1, 1, 1, 1, 1, 1, |
226 | 1, 1, 1, 1, 1, 1, 1, 1, |
227 | 1, 1, 1, 1, 1, 1, 1, 1, |
228 | 1, 1, 1, 1, 1, 1, 1, 1, |
229 | 1, 1, 1, 1, 1, 1, 1, 1, |
230 | 1, 1, 1, 1, 1, 1, 1, 1, |
231 | 1, 1, 1, 1, 1, 1, 1, 57, |
232 | 1, 58, 58, 58, 58, 58, 1, 1, |
233 | 1, 1, 1, 1, 1, 1, 1, 1, |
234 | 1, 1, 1, 1, 1, 1, 1, 1, |
235 | 58, 1, 1, 59, 1, 1, 1, 1, |
236 | 1, 1, 1, 60, 1, 1, 1, 1, |
237 | 1, 1, 1, 1, 1, 1, 1, 1, |
238 | 1, 1, 1, 1, 1, 1, 1, 1, |
239 | 1, 1, 1, 1, 1, 1, 1, 1, |
240 | 1, 1, 1, 1, 1, 1, 1, 1, |
241 | 1, 1, 1, 1, 1, 1, 1, 1, |
242 | 1, 1, 1, 1, 1, 1, 1, 1, |
243 | 1, 1, 1, 1, 1, 1, 1, 1, |
244 | 1, 1, 1, 1, 1, 1, 1, 1, |
245 | 1, 1, 1, 1, 1, 1, 1, 1, |
246 | 1, 1, 1, 1, 61, 1, 58, 58, |
247 | 58, 58, 58, 1, 1, 1, 1, 1, |
248 | 1, 1, 1, 1, 1, 1, 1, 1, |
249 | 1, 1, 1, 1, 1, 58, 1, 1, |
250 | 59, 1, 1, 1, 1, 1, 1, 1, |
251 | 60, 1, 1, 1, 1, 25, 25, 25, |
252 | 25, 25, 25, 25, 25, 25, 25, 1, |
253 | 1, 1, 1, 1, 1, 1, 1, 1, |
254 | 1, 1, 1, 1, 1, 1, 1, 1, |
255 | 1, 1, 1, 1, 1, 1, 1, 1, |
256 | 1, 1, 1, 1, 1, 1, 1, 1, |
257 | 1, 1, 1, 1, 1, 1, 1, 1, |
258 | 1, 1, 1, 1, 1, 1, 1, 1, |
259 | 1, 1, 1, 1, 1, 1, 1, 1, |
260 | 1, 1, 1, 1, 1, 1, 1, 1, |
261 | 1, 61, 1, 53, 53, 53, 53, 53, |
262 | 1, 1, 1, 1, 1, 1, 1, 1, |
263 | 1, 1, 1, 1, 1, 1, 1, 1, |
264 | 1, 1, 53, 1, 1, 54, 1, 1, |
265 | 1, 1, 1, 1, 1, 55, 1, 1, |
266 | 1, 1, 62, 62, 62, 62, 62, 62, |
267 | 62, 62, 62, 62, 1, 1, 1, 1, |
268 | 1, 1, 56, 1, 1, 1, 1, 1, |
269 | 1, 1, 1, 1, 1, 1, 1, 1, |
270 | 1, 1, 1, 1, 1, 1, 1, 1, |
271 | 1, 1, 1, 1, 1, 1, 1, 1, |
272 | 1, 1, 1, 1, 1, 1, 1, 1, |
273 | 1, 1, 1, 1, 1, 1, 1, 1, |
274 | 1, 1, 1, 1, 1, 1, 1, 1, |
275 | 1, 1, 1, 1, 1, 1, 57, 1, |
276 | 0 |
277 | }; |
278 | |
279 | static const char _deserialize_text_glyphs_trans_targs[] = { |
280 | 16, 0, 18, 3, 19, 22, 19, 22, |
281 | 5, 20, 21, 20, 21, 23, 26, 8, |
282 | 9, 12, 9, 12, 10, 11, 24, 25, |
283 | 24, 25, 15, 15, 14, 1, 2, 6, |
284 | 7, 13, 15, 1, 2, 6, 7, 13, |
285 | 14, 17, 14, 17, 14, 18, 17, 1, |
286 | 4, 14, 17, 1, 14, 17, 1, 2, |
287 | 7, 14, 17, 1, 2, 14, 26 |
288 | }; |
289 | |
290 | static const char _deserialize_text_glyphs_trans_actions[] = { |
291 | 1, 0, 1, 1, 1, 1, 0, 0, |
292 | 1, 1, 1, 0, 0, 1, 1, 1, |
293 | 1, 1, 0, 0, 2, 1, 1, 1, |
294 | 0, 0, 0, 4, 3, 5, 5, 5, |
295 | 5, 4, 6, 7, 7, 7, 7, 0, |
296 | 6, 8, 8, 0, 0, 0, 9, 10, |
297 | 10, 9, 11, 12, 11, 13, 14, 14, |
298 | 14, 13, 15, 16, 16, 15, 0 |
299 | }; |
300 | |
301 | static const char _deserialize_text_glyphs_eof_actions[] = { |
302 | 0, 0, 0, 0, 0, 0, 0, 0, |
303 | 0, 0, 0, 0, 0, 0, 3, 6, |
304 | 8, 0, 8, 9, 11, 11, 9, 13, |
305 | 15, 15, 13 |
306 | }; |
307 | |
308 | static const int deserialize_text_glyphs_start = 14; |
309 | static const int deserialize_text_glyphs_first_final = 14; |
310 | static const int deserialize_text_glyphs_error = 0; |
311 | |
312 | static const int deserialize_text_glyphs_en_main = 14; |
313 | |
314 | |
315 | #line 98 "hb-buffer-deserialize-text-glyphs.rl" |
316 | |
317 | |
318 | static hb_bool_t |
319 | _hb_buffer_deserialize_text_glyphs (hb_buffer_t *buffer, |
320 | const char *buf, |
321 | unsigned int buf_len, |
322 | const char **end_ptr, |
323 | hb_font_t *font) |
324 | { |
325 | const char *p = buf, *pe = buf + buf_len, *eof = pe, *orig_pe = pe; |
326 | |
327 | /* Ensure we have positions. */ |
328 | (void) hb_buffer_get_glyph_positions (buffer, nullptr); |
329 | |
330 | while (p < pe && ISSPACE (*p)) |
331 | p++; |
332 | if (p < pe && *p == (buffer->len ? '|' : '[')) |
333 | *end_ptr = ++p; |
334 | |
335 | const char *end = strchr ((char *) p, ']'); |
336 | if (end) |
337 | pe = eof = end; |
338 | else |
339 | { |
340 | end = strrchr ((char *) p, '|'); |
341 | if (end) |
342 | pe = eof = end; |
343 | else |
344 | pe = eof = p; |
345 | } |
346 | |
347 | const char *tok = nullptr; |
348 | int cs; |
349 | hb_glyph_info_t info = {0}; |
350 | hb_glyph_position_t pos = {0}; |
351 | |
352 | #line 346 "hb-buffer-deserialize-text-glyphs.hh" |
353 | { |
354 | cs = deserialize_text_glyphs_start; |
355 | } |
356 | |
357 | #line 349 "hb-buffer-deserialize-text-glyphs.hh" |
358 | { |
359 | int _slen; |
360 | int _trans; |
361 | const unsigned char *_keys; |
362 | const char *_inds; |
363 | if ( p == pe ) |
364 | goto _test_eof; |
365 | if ( cs == 0 ) |
366 | goto _out; |
367 | _resume: |
368 | _keys = _deserialize_text_glyphs_trans_keys + (cs<<1); |
369 | _inds = _deserialize_text_glyphs_indicies + _deserialize_text_glyphs_index_offsets[cs]; |
370 | |
371 | _slen = _deserialize_text_glyphs_key_spans[cs]; |
372 | _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && |
373 | (*p) <= _keys[1] ? |
374 | (*p) - _keys[0] : _slen ]; |
375 | |
376 | cs = _deserialize_text_glyphs_trans_targs[_trans]; |
377 | |
378 | if ( _deserialize_text_glyphs_trans_actions[_trans] == 0 ) |
379 | goto _again; |
380 | |
381 | switch ( _deserialize_text_glyphs_trans_actions[_trans] ) { |
382 | case 1: |
383 | #line 51 "hb-buffer-deserialize-text-glyphs.rl" |
384 | { |
385 | tok = p; |
386 | } |
387 | break; |
388 | case 7: |
389 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
390 | { |
391 | /* TODO Unescape delimiters. */ |
392 | if (!hb_font_glyph_from_string (font, |
393 | tok, p - tok, |
394 | &info.codepoint)) |
395 | return false; |
396 | } |
397 | break; |
398 | case 14: |
399 | #line 63 "hb-buffer-deserialize-text-glyphs.rl" |
400 | { if (!parse_uint (tok, p, &info.cluster )) return false; } |
401 | break; |
402 | case 2: |
403 | #line 64 "hb-buffer-deserialize-text-glyphs.rl" |
404 | { if (!parse_int (tok, p, &pos.x_offset )) return false; } |
405 | break; |
406 | case 16: |
407 | #line 65 "hb-buffer-deserialize-text-glyphs.rl" |
408 | { if (!parse_int (tok, p, &pos.y_offset )) return false; } |
409 | break; |
410 | case 10: |
411 | #line 66 "hb-buffer-deserialize-text-glyphs.rl" |
412 | { if (!parse_int (tok, p, &pos.x_advance)) return false; } |
413 | break; |
414 | case 12: |
415 | #line 67 "hb-buffer-deserialize-text-glyphs.rl" |
416 | { if (!parse_int (tok, p, &pos.y_advance)) return false; } |
417 | break; |
418 | case 4: |
419 | #line 38 "hb-buffer-deserialize-text-glyphs.rl" |
420 | { |
421 | hb_memset (&info, 0, sizeof (info)); |
422 | hb_memset (&pos , 0, sizeof (pos )); |
423 | } |
424 | #line 51 "hb-buffer-deserialize-text-glyphs.rl" |
425 | { |
426 | tok = p; |
427 | } |
428 | break; |
429 | case 6: |
430 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
431 | { |
432 | /* TODO Unescape delimiters. */ |
433 | if (!hb_font_glyph_from_string (font, |
434 | tok, p - tok, |
435 | &info.codepoint)) |
436 | return false; |
437 | } |
438 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
439 | { |
440 | buffer->add_info (info); |
441 | if (unlikely (!buffer->successful)) |
442 | return false; |
443 | buffer->pos[buffer->len - 1] = pos; |
444 | *end_ptr = p; |
445 | } |
446 | break; |
447 | case 13: |
448 | #line 63 "hb-buffer-deserialize-text-glyphs.rl" |
449 | { if (!parse_uint (tok, p, &info.cluster )) return false; } |
450 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
451 | { |
452 | buffer->add_info (info); |
453 | if (unlikely (!buffer->successful)) |
454 | return false; |
455 | buffer->pos[buffer->len - 1] = pos; |
456 | *end_ptr = p; |
457 | } |
458 | break; |
459 | case 15: |
460 | #line 65 "hb-buffer-deserialize-text-glyphs.rl" |
461 | { if (!parse_int (tok, p, &pos.y_offset )) return false; } |
462 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
463 | { |
464 | buffer->add_info (info); |
465 | if (unlikely (!buffer->successful)) |
466 | return false; |
467 | buffer->pos[buffer->len - 1] = pos; |
468 | *end_ptr = p; |
469 | } |
470 | break; |
471 | case 9: |
472 | #line 66 "hb-buffer-deserialize-text-glyphs.rl" |
473 | { if (!parse_int (tok, p, &pos.x_advance)) return false; } |
474 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
475 | { |
476 | buffer->add_info (info); |
477 | if (unlikely (!buffer->successful)) |
478 | return false; |
479 | buffer->pos[buffer->len - 1] = pos; |
480 | *end_ptr = p; |
481 | } |
482 | break; |
483 | case 11: |
484 | #line 67 "hb-buffer-deserialize-text-glyphs.rl" |
485 | { if (!parse_int (tok, p, &pos.y_advance)) return false; } |
486 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
487 | { |
488 | buffer->add_info (info); |
489 | if (unlikely (!buffer->successful)) |
490 | return false; |
491 | buffer->pos[buffer->len - 1] = pos; |
492 | *end_ptr = p; |
493 | } |
494 | break; |
495 | case 8: |
496 | #line 68 "hb-buffer-deserialize-text-glyphs.rl" |
497 | { if (!parse_uint (tok, p, &info.mask )) return false; } |
498 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
499 | { |
500 | buffer->add_info (info); |
501 | if (unlikely (!buffer->successful)) |
502 | return false; |
503 | buffer->pos[buffer->len - 1] = pos; |
504 | *end_ptr = p; |
505 | } |
506 | break; |
507 | case 5: |
508 | #line 38 "hb-buffer-deserialize-text-glyphs.rl" |
509 | { |
510 | hb_memset (&info, 0, sizeof (info)); |
511 | hb_memset (&pos , 0, sizeof (pos )); |
512 | } |
513 | #line 51 "hb-buffer-deserialize-text-glyphs.rl" |
514 | { |
515 | tok = p; |
516 | } |
517 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
518 | { |
519 | /* TODO Unescape delimiters. */ |
520 | if (!hb_font_glyph_from_string (font, |
521 | tok, p - tok, |
522 | &info.codepoint)) |
523 | return false; |
524 | } |
525 | break; |
526 | case 3: |
527 | #line 38 "hb-buffer-deserialize-text-glyphs.rl" |
528 | { |
529 | hb_memset (&info, 0, sizeof (info)); |
530 | hb_memset (&pos , 0, sizeof (pos )); |
531 | } |
532 | #line 51 "hb-buffer-deserialize-text-glyphs.rl" |
533 | { |
534 | tok = p; |
535 | } |
536 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
537 | { |
538 | /* TODO Unescape delimiters. */ |
539 | if (!hb_font_glyph_from_string (font, |
540 | tok, p - tok, |
541 | &info.codepoint)) |
542 | return false; |
543 | } |
544 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
545 | { |
546 | buffer->add_info (info); |
547 | if (unlikely (!buffer->successful)) |
548 | return false; |
549 | buffer->pos[buffer->len - 1] = pos; |
550 | *end_ptr = p; |
551 | } |
552 | break; |
553 | #line 516 "hb-buffer-deserialize-text-glyphs.hh" |
554 | } |
555 | |
556 | _again: |
557 | if ( cs == 0 ) |
558 | goto _out; |
559 | if ( ++p != pe ) |
560 | goto _resume; |
561 | _test_eof: {} |
562 | if ( p == eof ) |
563 | { |
564 | switch ( _deserialize_text_glyphs_eof_actions[cs] ) { |
565 | case 6: |
566 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
567 | { |
568 | /* TODO Unescape delimiters. */ |
569 | if (!hb_font_glyph_from_string (font, |
570 | tok, p - tok, |
571 | &info.codepoint)) |
572 | return false; |
573 | } |
574 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
575 | { |
576 | buffer->add_info (info); |
577 | if (unlikely (!buffer->successful)) |
578 | return false; |
579 | buffer->pos[buffer->len - 1] = pos; |
580 | *end_ptr = p; |
581 | } |
582 | break; |
583 | case 13: |
584 | #line 63 "hb-buffer-deserialize-text-glyphs.rl" |
585 | { if (!parse_uint (tok, p, &info.cluster )) return false; } |
586 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
587 | { |
588 | buffer->add_info (info); |
589 | if (unlikely (!buffer->successful)) |
590 | return false; |
591 | buffer->pos[buffer->len - 1] = pos; |
592 | *end_ptr = p; |
593 | } |
594 | break; |
595 | case 15: |
596 | #line 65 "hb-buffer-deserialize-text-glyphs.rl" |
597 | { if (!parse_int (tok, p, &pos.y_offset )) return false; } |
598 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
599 | { |
600 | buffer->add_info (info); |
601 | if (unlikely (!buffer->successful)) |
602 | return false; |
603 | buffer->pos[buffer->len - 1] = pos; |
604 | *end_ptr = p; |
605 | } |
606 | break; |
607 | case 9: |
608 | #line 66 "hb-buffer-deserialize-text-glyphs.rl" |
609 | { if (!parse_int (tok, p, &pos.x_advance)) return false; } |
610 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
611 | { |
612 | buffer->add_info (info); |
613 | if (unlikely (!buffer->successful)) |
614 | return false; |
615 | buffer->pos[buffer->len - 1] = pos; |
616 | *end_ptr = p; |
617 | } |
618 | break; |
619 | case 11: |
620 | #line 67 "hb-buffer-deserialize-text-glyphs.rl" |
621 | { if (!parse_int (tok, p, &pos.y_advance)) return false; } |
622 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
623 | { |
624 | buffer->add_info (info); |
625 | if (unlikely (!buffer->successful)) |
626 | return false; |
627 | buffer->pos[buffer->len - 1] = pos; |
628 | *end_ptr = p; |
629 | } |
630 | break; |
631 | case 8: |
632 | #line 68 "hb-buffer-deserialize-text-glyphs.rl" |
633 | { if (!parse_uint (tok, p, &info.mask )) return false; } |
634 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
635 | { |
636 | buffer->add_info (info); |
637 | if (unlikely (!buffer->successful)) |
638 | return false; |
639 | buffer->pos[buffer->len - 1] = pos; |
640 | *end_ptr = p; |
641 | } |
642 | break; |
643 | case 3: |
644 | #line 38 "hb-buffer-deserialize-text-glyphs.rl" |
645 | { |
646 | hb_memset (&info, 0, sizeof (info)); |
647 | hb_memset (&pos , 0, sizeof (pos )); |
648 | } |
649 | #line 51 "hb-buffer-deserialize-text-glyphs.rl" |
650 | { |
651 | tok = p; |
652 | } |
653 | #line 55 "hb-buffer-deserialize-text-glyphs.rl" |
654 | { |
655 | /* TODO Unescape delimiters. */ |
656 | if (!hb_font_glyph_from_string (font, |
657 | tok, p - tok, |
658 | &info.codepoint)) |
659 | return false; |
660 | } |
661 | #line 43 "hb-buffer-deserialize-text-glyphs.rl" |
662 | { |
663 | buffer->add_info (info); |
664 | if (unlikely (!buffer->successful)) |
665 | return false; |
666 | buffer->pos[buffer->len - 1] = pos; |
667 | *end_ptr = p; |
668 | } |
669 | break; |
670 | #line 616 "hb-buffer-deserialize-text-glyphs.hh" |
671 | } |
672 | } |
673 | |
674 | _out: {} |
675 | } |
676 | |
677 | #line 136 "hb-buffer-deserialize-text-glyphs.rl" |
678 | |
679 | |
680 | if (pe < orig_pe && *pe == ']') |
681 | { |
682 | pe++; |
683 | if (p == pe) |
684 | p++; |
685 | } |
686 | |
687 | *end_ptr = p; |
688 | |
689 | return p == pe; |
690 | } |
691 | |
692 | #endif /* HB_BUFFER_DESERIALIZE_TEXT_GLYPHS_HH */ |
693 | |