../3rdparty/harfbuzz/src/harfbuzz-indic.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5static HB_Bool isLetter(HB_UChar16 ucs) -
6{ -
7 const int test = (1 << (HB_Letter_Uppercase)) | -
8 (1 << (HB_Letter_Lowercase)) | -
9 (1 << (HB_Letter_Titlecase)) | -
10 (1 << (HB_Letter_Modifier)) | -
11 (1 << (HB_Letter_Other)); -
12 return ((1 << (HB_GetUnicodeCharCategory(ucs))) & test) != 0;
never executed: return ((1 << (HB_GetUnicodeCharCategory(ucs))) & test) != 0;
0
13} -
14 -
15static HB_Bool isMark(HB_UChar16 ucs) -
16{ -
17 const int test = (1 << (HB_Mark_NonSpacing)) | -
18 (1 << (HB_Mark_SpacingCombining)) | -
19 (1 << (HB_Mark_Enclosing)); -
20 return (1 << (HB_GetUnicodeCharCategory(ucs))) & test;
never executed: return (1 << (HB_GetUnicodeCharCategory(ucs))) & test;
0
21} -
22 -
23enum Form { -
24 Invalid = 0x0, -
25 UnknownForm = Invalid, -
26 Consonant, -
27 Nukta, -
28 Halant, -
29 Matra, -
30 VowelMark, -
31 StressMark, -
32 IndependentVowel, -
33 LengthMark, -
34 Control, -
35 Other -
36}; -
37 -
38static const unsigned char indicForms[0xe00-0x900] = { -
39 -
40 Invalid, VowelMark, VowelMark, VowelMark, -
41 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
42 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
43 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
44 -
45 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
46 IndependentVowel, Consonant, Consonant, Consonant, -
47 Consonant, Consonant, Consonant, Consonant, -
48 Consonant, Consonant, Consonant, Consonant, -
49 -
50 Consonant, Consonant, Consonant, Consonant, -
51 Consonant, Consonant, Consonant, Consonant, -
52 Consonant, Consonant, Consonant, Consonant, -
53 Consonant, Consonant, Consonant, Consonant, -
54 -
55 Consonant, Consonant, Consonant, Consonant, -
56 Consonant, Consonant, Consonant, Consonant, -
57 Consonant, Consonant, UnknownForm, UnknownForm, -
58 Nukta, Other, Matra, Matra, -
59 -
60 Matra, Matra, Matra, Matra, -
61 Matra, Matra, Matra, Matra, -
62 Matra, Matra, Matra, Matra, -
63 Matra, Halant, UnknownForm, UnknownForm, -
64 -
65 Other, StressMark, StressMark, StressMark, -
66 StressMark, UnknownForm, UnknownForm, UnknownForm, -
67 Consonant, Consonant, Consonant, Consonant, -
68 Consonant, Consonant, Consonant, Consonant, -
69 -
70 IndependentVowel, IndependentVowel, VowelMark, VowelMark, -
71 Other, Other, Other, Other, -
72 Other, Other, Other, Other, -
73 Other, Other, Other, Other, -
74 -
75 Other, Other, Other, Other, -
76 Other, Other, Other, Other, -
77 Other, Other, Other, Consonant, -
78 Consonant, Consonant , Consonant, Consonant, -
79 -
80 -
81 Invalid, VowelMark, VowelMark, VowelMark, -
82 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
83 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
84 IndependentVowel, Invalid, Invalid, IndependentVowel, -
85 -
86 IndependentVowel, Invalid, Invalid, IndependentVowel, -
87 IndependentVowel, Consonant, Consonant, Consonant, -
88 Consonant, Consonant, Consonant, Consonant, -
89 Consonant, Consonant, Consonant, Consonant, -
90 -
91 Consonant, Consonant, Consonant, Consonant, -
92 Consonant, Consonant, Consonant, Consonant, -
93 Consonant, Invalid, Consonant, Consonant, -
94 Consonant, Consonant, Consonant, Consonant, -
95 -
96 Consonant, Invalid, Consonant, Invalid, -
97 Invalid, Invalid, Consonant, Consonant, -
98 Consonant, Consonant, UnknownForm, UnknownForm, -
99 Nukta, Other, Matra, Matra, -
100 -
101 Matra, Matra, Matra, Matra, -
102 Matra, Invalid, Invalid, Matra, -
103 Matra, Invalid, Invalid, Matra, -
104 Matra, Halant, Consonant, UnknownForm, -
105 -
106 Invalid, Invalid, Invalid, Invalid, -
107 Invalid, Invalid, Invalid, VowelMark, -
108 Invalid, Invalid, Invalid, Invalid, -
109 Consonant, Consonant, Invalid, Consonant, -
110 -
111 IndependentVowel, IndependentVowel, VowelMark, VowelMark, -
112 Other, Other, Other, Other, -
113 Other, Other, Other, Other, -
114 Other, Other, Other, Other, -
115 -
116 Consonant, Consonant, Other, Other, -
117 Other, Other, Other, Other, -
118 Other, Other, Other, Other, -
119 Other, Other, Other, Other, -
120 -
121 -
122 Invalid, VowelMark, VowelMark, VowelMark, -
123 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
124 IndependentVowel, IndependentVowel, IndependentVowel, Invalid, -
125 Invalid, Invalid, Invalid, IndependentVowel, -
126 -
127 IndependentVowel, Invalid, Invalid, IndependentVowel, -
128 IndependentVowel, Consonant, Consonant, Consonant, -
129 Consonant, Consonant, Consonant, Consonant, -
130 Consonant, Consonant, Consonant, Consonant, -
131 -
132 Consonant, Consonant, Consonant, Consonant, -
133 Consonant, Consonant, Consonant, Consonant, -
134 Consonant, Invalid, Consonant, Consonant, -
135 Consonant, Consonant, Consonant, Consonant, -
136 -
137 Consonant, Invalid, Consonant, Consonant, -
138 Invalid, Consonant, Consonant, Invalid, -
139 Consonant, Consonant, UnknownForm, UnknownForm, -
140 Nukta, Other, Matra, Matra, -
141 -
142 Matra, Matra, Matra, Invalid, -
143 Invalid, Invalid, Invalid, Matra, -
144 Matra, Invalid, Invalid, Matra, -
145 Matra, Halant, UnknownForm, UnknownForm, -
146 -
147 Invalid, Invalid, Invalid, Invalid, -
148 Invalid, UnknownForm, UnknownForm, UnknownForm, -
149 Invalid, Consonant, Consonant, Consonant, -
150 Consonant, Invalid, Consonant, Invalid, -
151 -
152 Other, Other, Invalid, Invalid, -
153 Other, Other, Other, Other, -
154 Other, Other, Other, Other, -
155 Other, Other, Other, Other, -
156 -
157 StressMark, StressMark, Consonant, Consonant, -
158 Other, Other, Other, Other, -
159 Other, Other, Other, Other, -
160 Other, Other, Other, Other, -
161 -
162 -
163 Invalid, VowelMark, VowelMark, VowelMark, -
164 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
165 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
166 IndependentVowel, IndependentVowel, Invalid, IndependentVowel, -
167 -
168 IndependentVowel, IndependentVowel, Invalid, IndependentVowel, -
169 IndependentVowel, Consonant, Consonant, Consonant, -
170 Consonant, Consonant, Consonant, Consonant, -
171 Consonant, Consonant, Consonant, Consonant, -
172 -
173 Consonant, Consonant, Consonant, Consonant, -
174 Consonant, Consonant, Consonant, Consonant, -
175 Consonant, Invalid, Consonant, Consonant, -
176 Consonant, Consonant, Consonant, Consonant, -
177 -
178 Consonant, Invalid, Consonant, Consonant, -
179 Invalid, Consonant, Consonant, Consonant, -
180 Consonant, Consonant, UnknownForm, UnknownForm, -
181 Nukta, Other, Matra, Matra, -
182 -
183 Matra, Matra, Matra, Matra, -
184 Matra, Matra, Invalid, Matra, -
185 Matra, Matra, Invalid, Matra, -
186 Matra, Halant, UnknownForm, UnknownForm, -
187 -
188 Other, UnknownForm, UnknownForm, UnknownForm, -
189 UnknownForm, UnknownForm, UnknownForm, UnknownForm, -
190 UnknownForm, UnknownForm, UnknownForm, UnknownForm, -
191 UnknownForm, UnknownForm, UnknownForm, UnknownForm, -
192 -
193 IndependentVowel, IndependentVowel, VowelMark, VowelMark, -
194 Other, Other, Other, Other, -
195 Other, Other, Other, Other, -
196 Other, Other, Other, Other, -
197 -
198 Other, Other, Other, Other, -
199 Other, Other, Other, Other, -
200 Other, Other, Other, Other, -
201 Other, Other, Other, Other, -
202 -
203 -
204 Invalid, VowelMark, VowelMark, VowelMark, -
205 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
206 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
207 IndependentVowel, Invalid, Invalid, IndependentVowel, -
208 -
209 IndependentVowel, Invalid, Invalid, IndependentVowel, -
210 IndependentVowel, Consonant, Consonant, Consonant, -
211 Consonant, Consonant, Consonant, Consonant, -
212 Consonant, Consonant, Consonant, Consonant, -
213 -
214 Consonant, Consonant, Consonant, Consonant, -
215 Consonant, Consonant, Consonant, Consonant, -
216 Consonant, Invalid, Consonant, Consonant, -
217 Consonant, Consonant, Consonant, Consonant, -
218 -
219 Consonant, Invalid, Consonant, Consonant, -
220 Invalid, Consonant, Consonant, Consonant, -
221 Consonant, Consonant, UnknownForm, UnknownForm, -
222 Nukta, Other, Matra, Matra, -
223 -
224 Matra, Matra, Matra, Matra, -
225 Invalid, Invalid, Invalid, Matra, -
226 Matra, Invalid, Invalid, Matra, -
227 Matra, Halant, UnknownForm, UnknownForm, -
228 -
229 Other, Invalid, Invalid, Invalid, -
230 Invalid, UnknownForm, LengthMark, LengthMark, -
231 Invalid, Invalid, Invalid, Invalid, -
232 Consonant, Consonant, Invalid, Consonant, -
233 -
234 IndependentVowel, IndependentVowel, Invalid, Invalid, -
235 Invalid, Invalid, Other, Other, -
236 Other, Other, Other, Other, -
237 Other, Other, Other, Other, -
238 -
239 Other, Consonant, Other, Other, -
240 Other, Other, Other, Other, -
241 Other, Other, Other, Other, -
242 Other, Other, Other, Other, -
243 -
244 -
245 Invalid, Invalid, VowelMark, Other, -
246 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
247 IndependentVowel, IndependentVowel, IndependentVowel, Invalid, -
248 Invalid, Invalid, IndependentVowel, IndependentVowel, -
249 -
250 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
251 IndependentVowel, Consonant, Invalid, Invalid, -
252 Invalid, Consonant, Consonant, Invalid, -
253 Consonant, Invalid, Consonant, Consonant, -
254 -
255 Invalid, Invalid, Invalid, Consonant, -
256 Consonant, Invalid, Invalid, Invalid, -
257 Consonant, Consonant, Consonant, Invalid, -
258 Invalid, Invalid, Consonant, Consonant, -
259 -
260 Consonant, Consonant, Consonant, Consonant, -
261 Consonant, Consonant, Consonant, Consonant, -
262 Consonant, Consonant, UnknownForm, UnknownForm, -
263 Invalid, Invalid, Matra, Matra, -
264 -
265 Matra, Matra, Matra, Invalid, -
266 Invalid, Invalid, Matra, Matra, -
267 Matra, Invalid, Matra, Matra, -
268 Matra, Halant, Invalid, Invalid, -
269 -
270 Invalid, Invalid, Invalid, Invalid, -
271 Invalid, Invalid, Invalid, LengthMark, -
272 Invalid, Invalid, Invalid, Invalid, -
273 Invalid, Invalid, Invalid, Invalid, -
274 -
275 Invalid, Invalid, Invalid, Invalid, -
276 Invalid, Invalid, Other, Other, -
277 Other, Other, Other, Other, -
278 Other, Other, Other, Other, -
279 -
280 Other, Other, Other, Other, -
281 Other, Other, Other, Other, -
282 Other, Other, Other, Other, -
283 Other, Other, Other, Other, -
284 -
285 -
286 Invalid, VowelMark, VowelMark, VowelMark, -
287 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
288 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
289 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
290 -
291 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
292 IndependentVowel, Consonant, Consonant, Consonant, -
293 Consonant, Consonant, Consonant, Consonant, -
294 Consonant, Consonant, Consonant, Consonant, -
295 -
296 Consonant, Consonant, Consonant, Consonant, -
297 Consonant, Consonant, Consonant, Consonant, -
298 Consonant, Invalid, Consonant, Consonant, -
299 Consonant, Consonant, Consonant, Consonant, -
300 -
301 Consonant, Consonant, Consonant, Consonant, -
302 Invalid, Consonant, Consonant, Consonant, -
303 Consonant, Consonant, UnknownForm, UnknownForm, -
304 Invalid, Invalid, Matra, Matra, -
305 -
306 Matra, Matra, Matra, Matra, -
307 Matra, Invalid, Matra, Matra, -
308 Matra, Invalid, Matra, Matra, -
309 Matra, Halant, Invalid, Invalid, -
310 -
311 Invalid, Invalid, Invalid, Invalid, -
312 Invalid, LengthMark, Matra, Invalid, -
313 Invalid, Invalid, Invalid, Invalid, -
314 Invalid, Invalid, Invalid, Invalid, -
315 -
316 IndependentVowel, IndependentVowel, Invalid, Invalid, -
317 Invalid, Invalid, Other, Other, -
318 Other, Other, Other, Other, -
319 Other, Other, Other, Other, -
320 -
321 Other, Other, Other, Other, -
322 Other, Other, Other, Other, -
323 Other, Other, Other, Other, -
324 Other, Other, Other, Other, -
325 -
326 -
327 Invalid, Invalid, VowelMark, VowelMark, -
328 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
329 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
330 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
331 -
332 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
333 IndependentVowel, Consonant, Consonant, Consonant, -
334 Consonant, Consonant, Consonant, Consonant, -
335 Consonant, Consonant, Consonant, Consonant, -
336 -
337 Consonant, Consonant, Consonant, Consonant, -
338 Consonant, Consonant, Consonant, Consonant, -
339 Consonant, Invalid, Consonant, Consonant, -
340 Consonant, Consonant, Consonant, Consonant, -
341 -
342 Consonant, Consonant, Consonant, Consonant, -
343 Invalid, Consonant, Consonant, Consonant, -
344 Consonant, Consonant, UnknownForm, UnknownForm, -
345 Nukta, Other, Matra, Matra, -
346 -
347 Matra, Matra, Matra, Matra, -
348 Matra, Invalid, Matra, Matra, -
349 Matra, Invalid, Matra, Matra, -
350 Matra, Halant, Invalid, Invalid, -
351 -
352 Invalid, Invalid, Invalid, Invalid, -
353 Invalid, LengthMark, LengthMark, Invalid, -
354 Invalid, Invalid, Invalid, Invalid, -
355 Invalid, Invalid, Consonant, Invalid, -
356 -
357 IndependentVowel, IndependentVowel, VowelMark, VowelMark, -
358 Invalid, Invalid, Other, Other, -
359 Other, Other, Other, Other, -
360 Other, Other, Other, Other, -
361 -
362 Other, Other, Other, Other, -
363 Other, Other, Other, Other, -
364 Other, Other, Other, Other, -
365 Other, Other, Other, Other, -
366 -
367 -
368 Invalid, Invalid, VowelMark, VowelMark, -
369 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
370 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
371 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
372 -
373 IndependentVowel, Invalid, IndependentVowel, IndependentVowel, -
374 IndependentVowel, Consonant, Consonant, Consonant, -
375 Consonant, Consonant, Consonant, Consonant, -
376 Consonant, Consonant, Consonant, Consonant, -
377 -
378 Consonant, Consonant, Consonant, Consonant, -
379 Consonant, Consonant, Consonant, Consonant, -
380 Consonant, Invalid, Consonant, Consonant, -
381 Consonant, Consonant, Consonant, Consonant, -
382 -
383 Consonant, Consonant, Consonant, Consonant, -
384 Consonant, Consonant, Consonant, Consonant, -
385 Consonant, Consonant, UnknownForm, UnknownForm, -
386 Invalid, Invalid, Matra, Matra, -
387 -
388 Matra, Matra, Matra, Matra, -
389 Invalid, Invalid, Matra, Matra, -
390 Matra, Invalid, Matra, Matra, -
391 Matra, Halant, Invalid, Invalid, -
392 -
393 Invalid, Invalid, Invalid, Invalid, -
394 Invalid, Invalid, Invalid, Matra, -
395 Invalid, Invalid, Invalid, Invalid, -
396 Invalid, Invalid, Invalid, Invalid, -
397 -
398 IndependentVowel, IndependentVowel, Invalid, Invalid, -
399 Invalid, Invalid, Other, Other, -
400 Other, Other, Other, Other, -
401 Other, Other, Other, Other, -
402 -
403 Other, Other, Other, Other, -
404 Other, Other, Other, Other, -
405 Other, Other, Other, Other, -
406 Other, Other, Other, Other, -
407 -
408 -
409 Invalid, Invalid, VowelMark, VowelMark, -
410 Invalid, IndependentVowel, IndependentVowel, IndependentVowel, -
411 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
412 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
413 -
414 IndependentVowel, IndependentVowel, IndependentVowel, IndependentVowel, -
415 IndependentVowel, IndependentVowel, IndependentVowel, Invalid, -
416 Invalid, Invalid, Consonant, Consonant, -
417 Consonant, Consonant, Consonant, Consonant, -
418 -
419 Consonant, Consonant, Consonant, Consonant, -
420 Consonant, Consonant, Consonant, Consonant, -
421 Consonant, Consonant, Consonant, Consonant, -
422 Consonant, Consonant, Consonant, Consonant, -
423 -
424 Consonant, Consonant, Invalid, Consonant, -
425 Consonant, Consonant, Consonant, Consonant, -
426 Consonant, Consonant, Consonant, Consonant, -
427 Invalid, Consonant, Invalid, Invalid, -
428 -
429 Consonant, Consonant, Consonant, Consonant, -
430 Consonant, Consonant, Consonant, Invalid, -
431 Invalid, Invalid, Halant, Invalid, -
432 Invalid, Invalid, Invalid, Matra, -
433 -
434 Matra, Matra, Matra, Matra, -
435 Matra, Invalid, Matra, Invalid, -
436 Matra, Matra, Matra, Matra, -
437 Matra, Matra, Matra, Matra, -
438 -
439 Invalid, Invalid, Invalid, Invalid, -
440 Invalid, Invalid, Invalid, Invalid, -
441 Invalid, Invalid, Invalid, Invalid, -
442 Invalid, Invalid, Invalid, Invalid, -
443 -
444 Invalid, Invalid, Matra, Matra, -
445 Other, Other, Other, Other, -
446 Other, Other, Other, Other, -
447 Other, Other, Other, Other, -
448}; -
449 -
450enum Position { -
451 None, -
452 Pre, -
453 Above, -
454 Below, -
455 Post, -
456 Split, -
457 Base, -
458 Reph, -
459 Vattu, -
460 Inherit -
461}; -
462 -
463static const unsigned char indicPosition[0xe00-0x900] = { -
464 -
465 None, Above, Above, Post, -
466 None, None, None, None, -
467 None, None, None, None, -
468 None, None, None, None, -
469 -
470 None, None, None, None, -
471 None, None, None, None, -
472 None, None, None, None, -
473 None, None, None, None, -
474 -
475 None, None, None, None, -
476 None, None, None, None, -
477 None, None, None, None, -
478 None, None, None, None, -
479 -
480 Below, None, None, None, -
481 None, None, None, None, -
482 None, None, None, None, -
483 None, None, Post, Pre, -
484 -
485 Post, Below, Below, Below, -
486 Below, Above, Above, Above, -
487 Above, Post, Post, Post, -
488 Post, None, None, None, -
489 -
490 None, Above, Below, Above, -
491 Above, None, None, None, -
492 None, None, None, None, -
493 None, None, None, None, -
494 -
495 None, None, Below, Below, -
496 None, None, None, None, -
497 None, None, None, None, -
498 None, None, None, None, -
499 -
500 None, None, None, None, -
501 None, None, None, None, -
502 None, None, None, None, -
503 None, None, None, None, -
504 -
505 -
506 None, Above, Post, Post, -
507 None, None, None, None, -
508 None, None, None, None, -
509 None, None, None, None, -
510 -
511 None, None, None, None, -
512 None, None, None, None, -
513 None, None, None, None, -
514 None, None, None, None, -
515 -
516 None, None, None, None, -
517 None, None, None, None, -
518 None, None, None, None, -
519 Below, None, None, Post, -
520 -
521 Below, None, None, None, -
522 None, None, None, None, -
523 None, None, None, None, -
524 Below, None, Post, Pre, -
525 -
526 Post, Below, Below, Below, -
527 Below, None, None, Pre, -
528 Pre, None, None, Split, -
529 Split, Below, None, None, -
530 -
531 None, None, None, None, -
532 None, None, None, Post, -
533 None, None, None, None, -
534 None, None, None, None, -
535 -
536 None, None, Below, Below, -
537 None, None, None, None, -
538 None, None, None, None, -
539 None, None, None, None, -
540 -
541 Below, None, None, None, -
542 None, None, None, None, -
543 None, None, None, None, -
544 None, None, None, None, -
545 -
546 -
547 None, Above, Above, Post, -
548 None, None, None, None, -
549 None, None, None, None, -
550 None, None, None, None, -
551 -
552 None, None, None, None, -
553 None, None, None, None, -
554 None, None, None, None, -
555 None, None, None, None, -
556 -
557 None, None, None, None, -
558 None, None, None, None, -
559 None, None, None, None, -
560 None, None, None, Post, -
561 -
562 Below, None, None, None, -
563 None, Below, None, None, -
564 None, Below, None, None, -
565 Below, None, Post, Pre, -
566 -
567 Post, Below, Below, None, -
568 None, None, None, Above, -
569 Above, None, None, Above, -
570 Above, None, None, None, -
571 -
572 None, None, None, None, -
573 None, None, None, None, -
574 None, None, None, None, -
575 None, None, None, None, -
576 -
577 None, None, None, None, -
578 None, None, None, None, -
579 None, None, None, None, -
580 None, None, None, None, -
581 -
582 Above, Above, None, None, -
583 None, None, None, None, -
584 None, None, None, None, -
585 None, None, None, None, -
586 -
587 -
588 None, Above, Above, Post, -
589 None, None, None, None, -
590 None, None, None, None, -
591 None, None, None, None, -
592 -
593 None, None, None, None, -
594 None, None, None, None, -
595 None, None, None, None, -
596 None, None, None, None, -
597 -
598 None, None, None, None, -
599 None, None, None, None, -
600 None, None, None, None, -
601 None, None, None, None, -
602 -
603 Below, None, None, None, -
604 None, None, None, None, -
605 None, None, None, None, -
606 None, None, Post, Pre, -
607 -
608 Post, Below, Below, Below, -
609 Below, Above, None, Above, -
610 Above, Post, None, Post, -
611 Post, None, None, None, -
612 -
613 None, None, None, None, -
614 None, None, None, None, -
615 None, None, None, None, -
616 None, None, None, None, -
617 -
618 None, None, Below, Below, -
619 None, None, None, None, -
620 None, None, None, None, -
621 None, None, None, None, -
622 -
623 None, None, None, None, -
624 None, None, None, None, -
625 None, None, None, None, -
626 None, None, None, None, -
627 -
628 -
629 None, Above, Post, Post, -
630 None, None, None, None, -
631 None, None, None, None, -
632 None, None, None, None, -
633 -
634 None, None, None, None, -
635 None, Below, Below, Below, -
636 Below, Below, Below, Below, -
637 Below, Below, None, Below, -
638 -
639 Below, Below, Below, Below, -
640 Below, Below, Below, Below, -
641 Below, None, Below, Below, -
642 Below, Below, Below, Post, -
643 -
644 Below, None, Below, Below, -
645 None, Below, Below, Below, -
646 Below, Below, None, None, -
647 None, None, Post, Above, -
648 -
649 Post, Below, Below, Below, -
650 None, None, None, Pre, -
651 Split, None, None, Split, -
652 Split, None, None, None, -
653 -
654 None, None, None, None, -
655 None, None, Above, Post, -
656 None, None, None, None, -
657 None, None, None, Post, -
658 -
659 None, None, None, None, -
660 None, None, None, None, -
661 None, None, None, None, -
662 None, None, None, None, -
663 -
664 None, Below, None, None, -
665 None, None, None, None, -
666 None, None, None, None, -
667 None, None, None, None, -
668 -
669 -
670 None, None, Above, None, -
671 None, None, None, None, -
672 None, None, None, None, -
673 None, None, None, None, -
674 -
675 None, None, None, None, -
676 None, None, None, None, -
677 None, None, None, None, -
678 None, None, None, None, -
679 -
680 None, None, None, None, -
681 None, None, None, None, -
682 None, None, None, None, -
683 None, None, None, None, -
684 -
685 None, None, None, None, -
686 None, None, None, None, -
687 None, None, None, None, -
688 None, None, Post, Post, -
689 -
690 Above, Below, Below, None, -
691 None, None, Pre, Pre, -
692 Pre, None, Split, Split, -
693 Split, Halant, None, None, -
694 -
695 None, None, None, None, -
696 None, None, None, Post, -
697 None, None, None, None, -
698 None, None, None, None, -
699 -
700 None, None, None, None, -
701 None, None, None, None, -
702 None, None, None, None, -
703 None, None, None, None, -
704 -
705 None, None, None, None, -
706 None, None, None, None, -
707 None, None, None, None, -
708 None, None, None, None, -
709 -
710 -
711 None, Post, Post, Post, -
712 None, None, None, None, -
713 None, None, None, None, -
714 None, None, None, None, -
715 -
716 None, None, None, None, -
717 None, Below, Below, Below, -
718 Below, Below, Below, Below, -
719 Below, Below, Below, Below, -
720 -
721 Below, Below, Below, Below, -
722 Below, Below, Below, Below, -
723 Below, None, Below, Below, -
724 Below, Below, Below, Below, -
725 -
726 Below, None, Below, Below, -
727 None, Below, Below, Below, -
728 Below, Below, None, None, -
729 None, None, Post, Above, -
730 -
731 Above, Post, Post, Post, -
732 Post, None, Above, Above, -
733 Split, None, Post, Above, -
734 Above, Halant, None, None, -
735 -
736 None, None, None, None, -
737 None, Above, Below, None, -
738 None, None, None, None, -
739 None, None, None, None, -
740 -
741 None, None, None, None, -
742 None, None, None, None, -
743 None, None, None, None, -
744 None, None, None, None, -
745 -
746 None, None, None, None, -
747 None, None, None, None, -
748 None, None, None, None, -
749 None, None, None, None, -
750 -
751 -
752 None, None, Post, Post, -
753 None, None, None, None, -
754 None, None, None, None, -
755 None, None, None, None, -
756 -
757 None, None, None, None, -
758 None, Below, Below, Below, -
759 Below, Below, Below, Below, -
760 Below, Below, Below, Below, -
761 -
762 Below, Below, Below, Below, -
763 Below, Below, Below, Below, -
764 Below, Below, Below, Below, -
765 Below, Below, Below, Below, -
766 -
767 Below, None, Below, Below, -
768 None, Below, Below, Below, -
769 Below, Below, None, None, -
770 None, None, Post, Above, -
771 -
772 Split, Post, Post, Post, -
773 Post, None, Above, Split, -
774 Split, None, Split, Split, -
775 Above, Halant, None, None, -
776 -
777 None, None, None, None, -
778 None, Post, Post, None, -
779 None, None, None, None, -
780 None, None, Below, None, -
781 -
782 None, None, Below, Below, -
783 None, None, None, None, -
784 None, None, None, None, -
785 None, None, None, None, -
786 -
787 None, None, None, None, -
788 None, None, None, None, -
789 None, None, None, None, -
790 None, None, None, None, -
791 -
792 -
793 None, None, Post, Post, -
794 None, None, None, None, -
795 None, None, None, None, -
796 None, None, None, None, -
797 -
798 None, None, None, None, -
799 None, None, None, None, -
800 None, None, None, None, -
801 None, None, None, None, -
802 -
803 None, None, None, None, -
804 None, None, None, None, -
805 None, None, None, None, -
806 None, None, None, Post, -
807 -
808 Pre, None, Below, None, -
809 None, Post, None, None, -
810 None, None, None, None, -
811 None, None, Post, Post, -
812 -
813 Post, Post, Post, Post, -
814 None, None, Pre, Pre, -
815 Pre, None, Split, Split, -
816 Split, Halant, None, None, -
817 -
818 None, None, None, None, -
819 None, None, None, Post, -
820 None, None, None, None, -
821 None, None, None, None, -
822 -
823 None, None, None, None, -
824 None, None, None, None, -
825 None, None, None, None, -
826 None, None, None, None, -
827 -
828 None, None, None, None, -
829 None, None, None, None, -
830 None, None, None, None, -
831 None, None, None, None, -
832 -
833 -
834 None, None, Post, Post, -
835 None, None, None, None, -
836 None, None, None, None, -
837 None, None, None, None, -
838 -
839 None, None, None, None, -
840 None, None, None, None, -
841 None, None, None, None, -
842 None, None, None, None, -
843 -
844 None, None, None, None, -
845 None, None, None, None, -
846 None, None, None, None, -
847 None, None, None, None, -
848 -
849 None, None, None, None, -
850 None, None, None, None, -
851 None, None, None, None, -
852 None, None, None, None, -
853 -
854 None, None, None, None, -
855 None, None, None, None, -
856 None, None, None, None, -
857 None, None, None, Post, -
858 -
859 Post, Post, Above, Above, -
860 Below, None, Below, None, -
861 Post, Pre, Split, Pre, -
862 Split, Split, Split, Post, -
863 -
864 None, None, None, None, -
865 None, None, None, None, -
866 None, None, None, None, -
867 None, None, None, None, -
868 -
869 None, None, Post, Post, -
870 None, None, None, None, -
871 None, None, None, None, -
872 None, None, None, None -
873}; -
874 -
875static inline Form form(unsigned short uc) { -
876 if (uc < 0x900 || uc > 0xdff) {
never evaluated: uc < 0x900
never evaluated: uc > 0xdff
0
877 if (uc == 0x25cc)
never evaluated: uc == 0x25cc
0
878 return Consonant;
never executed: return Consonant;
0
879 if (uc == 0x200c || uc == 0x200d)
never evaluated: uc == 0x200c
never evaluated: uc == 0x200d
0
880 return Control;
never executed: return Control;
0
881 return Other;
never executed: return Other;
0
882 } -
883 return (Form)indicForms[uc-0x900];
never executed: return (Form)indicForms[uc-0x900];
0
884} -
885 -
886static inline Position indic_position(unsigned short uc) { -
887 if (uc < 0x900 || uc > 0xdff)
never evaluated: uc < 0x900
never evaluated: uc > 0xdff
0
888 return None;
never executed: return None;
0
889 return (Position) indicPosition[uc-0x900];
never executed: return (Position) indicPosition[uc-0x900];
0
890} -
891 -
892 -
893enum IndicScriptProperties { -
894 HasReph = 0x01, -
895 HasSplit = 0x02 -
896}; -
897 -
898const hb_uint8 scriptProperties[10] = { -
899 -
900 HasReph, -
901 -
902 HasReph|HasSplit, -
903 -
904 0, -
905 -
906 HasReph, -
907 -
908 HasReph|HasSplit, -
909 -
910 HasSplit, -
911 -
912 HasSplit, -
913 -
914 HasSplit|HasReph, -
915 -
916 HasSplit, -
917 -
918 HasSplit -
919}; -
920 -
921struct IndicOrdering { -
922 Form form; -
923 Position position; -
924}; -
925 -
926static const IndicOrdering devanagari_order [] = { -
927 { Consonant, Below }, -
928 { Matra, Below }, -
929 { VowelMark, Below }, -
930 { StressMark, Below }, -
931 { Matra, Above }, -
932 { Matra, Post }, -
933 { Consonant, Reph }, -
934 { VowelMark, Above }, -
935 { StressMark, Above }, -
936 { VowelMark, Post }, -
937 { (Form)0, None } -
938}; -
939 -
940static const IndicOrdering bengali_order [] = { -
941 { Consonant, Below }, -
942 { Matra, Below }, -
943 { Matra, Above }, -
944 { Consonant, Reph }, -
945 { VowelMark, Above }, -
946 { Consonant, Post }, -
947 { Matra, Post }, -
948 { VowelMark, Post }, -
949 { (Form)0, None } -
950}; -
951 -
952static const IndicOrdering gurmukhi_order [] = { -
953 { Consonant, Below }, -
954 { Matra, Below }, -
955 { Matra, Above }, -
956 { Consonant, Post }, -
957 { Matra, Post }, -
958 { VowelMark, Above }, -
959 { (Form)0, None } -
960}; -
961 -
962static const IndicOrdering tamil_order [] = { -
963 { Matra, Above }, -
964 { Matra, Post }, -
965 { VowelMark, Post }, -
966 { (Form)0, None } -
967}; -
968 -
969static const IndicOrdering telugu_order [] = { -
970 { Matra, Above }, -
971 { Matra, Below }, -
972 { Matra, Post }, -
973 { Consonant, Below }, -
974 { Consonant, Post }, -
975 { VowelMark, Post }, -
976 { (Form)0, None } -
977}; -
978 -
979static const IndicOrdering kannada_order [] = { -
980 { Matra, Above }, -
981 { Matra, Post }, -
982 { Consonant, Below }, -
983 { Consonant, Post }, -
984 { LengthMark, Post }, -
985 { Consonant, Reph }, -
986 { VowelMark, Post }, -
987 { (Form)0, None } -
988}; -
989 -
990static const IndicOrdering malayalam_order [] = { -
991 { Consonant, Below }, -
992 { Matra, Below }, -
993 { Consonant, Reph }, -
994 { Consonant, Post }, -
995 { Matra, Post }, -
996 { VowelMark, Post }, -
997 { (Form)0, None } -
998}; -
999 -
1000static const IndicOrdering sinhala_order [] = { -
1001 { Matra, Below }, -
1002 { Matra, Above }, -
1003 { Matra, Post }, -
1004 { VowelMark, Post }, -
1005 { (Form)0, None } -
1006}; -
1007 -
1008static const IndicOrdering * const indic_order[] = { -
1009 devanagari_order, -
1010 bengali_order, -
1011 gurmukhi_order, -
1012 devanagari_order, -
1013 bengali_order, -
1014 tamil_order, -
1015 telugu_order, -
1016 kannada_order, -
1017 malayalam_order, -
1018 sinhala_order -
1019}; -
1020 -
1021 -
1022 -
1023 -
1024static const unsigned short split_matras[] = { -
1025 -
1026 -
1027 -
1028 0x9cb, 0x9c7, 0x9be, 0x0, -
1029 0x9cc, 0x9c7, 0x9d7, 0x0, -
1030 -
1031 0xb48, 0xb47, 0xb56, 0x0, -
1032 0xb4b, 0xb47, 0xb3e, 0x0, -
1033 0xb4c, 0xb47, 0xb57, 0x0, -
1034 -
1035 0xbca, 0xbc6, 0xbbe, 0x0, -
1036 0xbcb, 0xbc7, 0xbbe, 0x0, -
1037 0xbcc, 0xbc6, 0xbd7, 0x0, -
1038 -
1039 0xc48, 0xc46, 0xc56, 0x0, -
1040 -
1041 0xcc0, 0xcbf, 0xcd5, 0x0, -
1042 0xcc7, 0xcc6, 0xcd5, 0x0, -
1043 0xcc8, 0xcc6, 0xcd6, 0x0, -
1044 0xcca, 0xcc6, 0xcc2, 0x0, -
1045 0xccb, 0xcc6, 0xcc2, 0xcd5, -
1046 -
1047 0xd4a, 0xd46, 0xd3e, 0x0, -
1048 0xd4b, 0xd47, 0xd3e, 0x0, -
1049 0xd4c, 0xd46, 0xd57, 0x0, -
1050 -
1051 0xdda, 0xdd9, 0xdca, 0x0, -
1052 0xddc, 0xdd9, 0xdcf, 0x0, -
1053 0xddd, 0xdd9, 0xdcf, 0xdca, -
1054 0xdde, 0xdd9, 0xddf, 0x0, -
1055 0xffff -
1056}; -
1057 -
1058static inline void splitMatra(unsigned short *reordered, int matra, int &len) -
1059{ -
1060 unsigned short matra_uc = reordered[matra]; -
1061 -
1062 -
1063 const unsigned short *split = split_matras; -
1064 while (split[0] < matra_uc)
never evaluated: split[0] < matra_uc
0
1065 split += 4;
never executed: split += 4;
0
1066 -
1067 ((*split == matra_uc) ? static_cast<void> (0) : __assert_fail ("*split == matra_uc", "../3rdparty/harfbuzz/src/harfbuzz-indic.cpp", 1095, __PRETTY_FUNCTION__)); -
1068 ++split; -
1069 -
1070 int added_chars = split[2] == 0x0 ? 1 : 2;
never evaluated: split[2] == 0x0
0
1071 -
1072 memmove(reordered + matra + added_chars, reordered + matra, (len-matra)*sizeof(unsigned short)); -
1073 reordered[matra] = split[0]; -
1074 reordered[matra+1] = split[1]; -
1075 if(added_chars == 2)
never evaluated: added_chars == 2
0
1076 reordered[matra+2] = split[2];
never executed: reordered[matra+2] = split[2];
0
1077 len += added_chars; -
1078}
never executed: }
0
1079 -
1080 -
1081static const HB_OpenTypeFeature indic_features[] = { -
1082 { ( ( (HB_UInt)'l' << 24 ) | ( (HB_UInt)'o' << 16 ) | ( (HB_UInt)'c' << 8 ) | (HB_UInt)'a' ), LocaProperty }, -
1083 { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'c' << 16 ) | ( (HB_UInt)'m' << 8 ) | (HB_UInt)'p' ), CcmpProperty }, -
1084 { ( ( (HB_UInt)'i' << 24 ) | ( (HB_UInt)'n' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'t' ), InitProperty }, -
1085 { ( ( (HB_UInt)'n' << 24 ) | ( (HB_UInt)'u' << 16 ) | ( (HB_UInt)'k' << 8 ) | (HB_UInt)'t' ), NuktaProperty }, -
1086 { ( ( (HB_UInt)'a' << 24 ) | ( (HB_UInt)'k' << 16 ) | ( (HB_UInt)'h' << 8 ) | (HB_UInt)'n' ), AkhantProperty }, -
1087 { ( ( (HB_UInt)'r' << 24 ) | ( (HB_UInt)'p' << 16 ) | ( (HB_UInt)'h' << 8 ) | (HB_UInt)'f' ), RephProperty }, -
1088 { ( ( (HB_UInt)'b' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'w' << 8 ) | (HB_UInt)'f' ), BelowFormProperty }, -
1089 { ( ( (HB_UInt)'h' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'l' << 8 ) | (HB_UInt)'f' ), HalfFormProperty }, -
1090 { ( ( (HB_UInt)'p' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'t' << 8 ) | (HB_UInt)'f' ), PostFormProperty }, -
1091 { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'j' << 16 ) | ( (HB_UInt)'c' << 8 ) | (HB_UInt)'t' ), ConjunctFormProperty }, -
1092 { ( ( (HB_UInt)'v' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'t' << 8 ) | (HB_UInt)'u' ), VattuProperty }, -
1093 { ( ( (HB_UInt)'p' << 24 ) | ( (HB_UInt)'r' << 16 ) | ( (HB_UInt)'e' << 8 ) | (HB_UInt)'s' ), PreSubstProperty }, -
1094 { ( ( (HB_UInt)'b' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'w' << 8 ) | (HB_UInt)'s' ), BelowSubstProperty }, -
1095 { ( ( (HB_UInt)'a' << 24 ) | ( (HB_UInt)'b' << 16 ) | ( (HB_UInt)'v' << 8 ) | (HB_UInt)'s' ), AboveSubstProperty }, -
1096 { ( ( (HB_UInt)'p' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'t' << 8 ) | (HB_UInt)'s' ), PostSubstProperty }, -
1097 { ( ( (HB_UInt)'h' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'l' << 8 ) | (HB_UInt)'n' ), HalantProperty }, -
1098 { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'l' << 8 ) | (HB_UInt)'t' ), IndicCaltProperty }, -
1099 { 0, 0 } -
1100}; -
1101static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool invalid) -
1102{ -
1103 HB_Script script = item->item.script; -
1104 ((script >= HB_Script_Devanagari && script <= HB_Script_Sinhala) ? static_cast<void> (0) : __assert_fail ("script >= HB_Script_Devanagari && script <= HB_Script_Sinhala", "../3rdparty/harfbuzz/src/harfbuzz-indic.cpp", 1201, __PRETTY_FUNCTION__)); -
1105 const unsigned short script_base = 0x0900 + 0x80*(script-HB_Script_Devanagari); -
1106 const unsigned short ra = script_base + 0x30; -
1107 const unsigned short halant = script_base + 0x4d; -
1108 const unsigned short nukta = script_base + 0x3c; -
1109 bool control = false; -
1110 -
1111 int len = (int)item->item.length; -
1112 if(0) printf(">>>>> indic shape: from=%d, len=%d invalid=%d", item->item.pos, item->item.length, invalid);
never executed: printf(">>>>> indic shape: from=%d, len=%d invalid=%d", item->item.pos, item->item.length, invalid);
never evaluated: 0
0
1113 -
1114 if ((int)item->num_glyphs < len+4) {
never evaluated: (int)item->num_glyphs < len+4
0
1115 item->num_glyphs = len+4; -
1116 return false;
never executed: return false;
0
1117 } -
1118 -
1119 HB_UChar16 stackreordered[512]; HB_UChar16 *reordered = stackreordered; if ((len + 4) >= 512) reordered = (HB_UChar16 *)malloc((len + 4) * sizeof(HB_UChar16));;
never executed: reordered = (HB_UChar16 *)malloc((len + 4) * sizeof(HB_UChar16));
never evaluated: (len + 4) >= 512
0
1120 hb_uint8 stackposition[512]; hb_uint8 *position = stackposition; if ((len + 4) >= 512) position = (hb_uint8 *)malloc((len + 4) * sizeof(hb_uint8));;
never executed: position = (hb_uint8 *)malloc((len + 4) * sizeof(hb_uint8));
never evaluated: (len + 4) >= 512
0
1121 -
1122 unsigned char properties = scriptProperties[script-HB_Script_Devanagari]; -
1123 -
1124 if (invalid) {
never evaluated: invalid
0
1125 *reordered = 0x25cc; -
1126 memcpy(reordered+1, item->string + item->item.pos, len*sizeof(HB_UChar16)); -
1127 len++; -
1128 } else {
never executed: }
0
1129 memcpy(reordered, item->string + item->item.pos, len*sizeof(HB_UChar16)); -
1130 }
never executed: }
0
1131 if (reordered[len-1] == 0x200c)
never evaluated: reordered[len-1] == 0x200c
0
1132 len--;
never executed: len--;
0
1133 -
1134 int i; -
1135 int base = 0; -
1136 int reph = -1; -
1137 if (len != 1) {
never evaluated: len != 1
0
1138 HB_UChar16 *uc = reordered; -
1139 bool beginsWithRa = false; -
1140 if (form(*uc) == Consonant || (script == HB_Script_Bengali && form(*uc) == IndependentVowel)) {
never evaluated: form(*uc) == Consonant
never evaluated: script == HB_Script_Bengali
never evaluated: form(*uc) == IndependentVowel
0
1141 if ((properties & HasReph) && (len > 2) &&
never evaluated: (properties & HasReph)
never evaluated: (len > 2)
0
1142 (*uc == ra || *uc == 0x9f0) && *(uc+1) == halant)
never evaluated: *uc == ra
never evaluated: *uc == 0x9f0
never evaluated: *(uc+1) == halant
0
1143 beginsWithRa = true;
never executed: beginsWithRa = true;
0
1144 -
1145 if (beginsWithRa && form(*(uc+2)) == Control)
never evaluated: beginsWithRa
never evaluated: form(*(uc+2)) == Control
0
1146 beginsWithRa = false;
never executed: beginsWithRa = false;
0
1147 -
1148 base = (beginsWithRa ? 2 : 0);
never evaluated: beginsWithRa
0
1149 if(0) printf(" length = %d, beginsWithRa = %d, base=%d", len, beginsWithRa, base);
never evaluated: 0
never executed: printf(" length = %d, beginsWithRa = %d, base=%d", len, beginsWithRa, base);
0
1150 -
1151 int lastConsonant = 0; -
1152 int matra = -1; -
1153 -
1154 -
1155 -
1156 -
1157 -
1158 memset(position, 0, len); -
1159 if (script == HB_Script_Devanagari || script == HB_Script_Gujarati) {
never evaluated: script == HB_Script_Devanagari
never evaluated: script == HB_Script_Gujarati
0
1160 bool vattu = false; -
1161 for (i = base; i < len; ++i) {
never evaluated: i < len
0
1162 position[i] = form(uc[i]); -
1163 if (position[i] == Consonant) {
never evaluated: position[i] == Consonant
0
1164 lastConsonant = i; -
1165 vattu = (!vattu && uc[i] == ra);
never evaluated: !vattu
never evaluated: uc[i] == ra
0
1166 if (vattu) {
never evaluated: vattu
0
1167 if(0) printf("excluding vattu glyph at %d from base candidates", i);
never evaluated: 0
never executed: printf("excluding vattu glyph at %d from base candidates", i);
0
1168 position[i] = Vattu; -
1169 }
never executed: }
0
1170 } else if (position[i] == Matra) {
never evaluated: position[i] == Matra
never executed: }
0
1171 matra = i; -
1172 }
never executed: }
0
1173 } -
1174 } else {
never executed: }
0
1175 for (i = base; i < len; ++i) {
never evaluated: i < len
0
1176 position[i] = form(uc[i]); -
1177 if (position[i] == Consonant)
never evaluated: position[i] == Consonant
0
1178 lastConsonant = i;
never executed: lastConsonant = i;
0
1179 else if (matra < 0 && position[i] == Matra)
never evaluated: matra < 0
never evaluated: position[i] == Matra
0
1180 matra = i;
never executed: matra = i;
0
1181 } -
1182 }
never executed: }
0
1183 int skipped = 0; -
1184 Position pos = Post; -
1185 for (i = len-1; i >= base; i--) {
never evaluated: i >= base
0
1186 if (position[i] != Consonant && (position[i] != Control || script == HB_Script_Kannada))
never evaluated: position[i] != Consonant
never evaluated: position[i] != Control
never evaluated: script == HB_Script_Kannada
0
1187 continue;
never executed: continue;
0
1188 -
1189 if (i < len-1 && position[i] == Control && position[i+1] == Consonant) {
never evaluated: i < len-1
never evaluated: position[i] == Control
never evaluated: position[i+1] == Consonant
0
1190 base = i+1; -
1191 break;
never executed: break;
0
1192 } -
1193 -
1194 Position charPosition = indic_position(uc[i]); -
1195 if (pos == Post && charPosition == Post) {
never evaluated: pos == Post
never evaluated: charPosition == Post
0
1196 pos = Post; -
1197 } else if ((pos == Post || pos == Below) && charPosition == Below) {
never executed: }
never evaluated: pos == Post
never evaluated: pos == Below
never evaluated: charPosition == Below
0
1198 if (script == HB_Script_Devanagari || script == HB_Script_Gujarati)
never evaluated: script == HB_Script_Devanagari
never evaluated: script == HB_Script_Gujarati
0
1199 base = i;
never executed: base = i;
0
1200 pos = Below; -
1201 } else {
never executed: }
0
1202 base = i; -
1203 break;
never executed: break;
0
1204 } -
1205 if (skipped == 2 && (script == HB_Script_Kannada || script == HB_Script_Telugu)) {
never evaluated: skipped == 2
never evaluated: script == HB_Script_Kannada
never evaluated: script == HB_Script_Telugu
0
1206 base = i; -
1207 break;
never executed: break;
0
1208 } -
1209 ++skipped; -
1210 }
never executed: }
0
1211 -
1212 if(0) printf(" base consonant at %d skipped=%d, lastConsonant=%d", base, skipped, lastConsonant);
never evaluated: 0
never executed: printf(" base consonant at %d skipped=%d, lastConsonant=%d", base, skipped, lastConsonant);
0
1213 -
1214 -
1215 -
1216 -
1217 -
1218 -
1219 if (lastConsonant > base) {
never evaluated: lastConsonant > base
0
1220 int halantPos = 0; -
1221 if (uc[base+1] == halant)
never evaluated: uc[base+1] == halant
0
1222 halantPos = base + 1;
never executed: halantPos = base + 1;
0
1223 else if (uc[base+1] == nukta && uc[base+2] == halant)
never evaluated: uc[base+1] == nukta
never evaluated: uc[base+2] == halant
0
1224 halantPos = base + 2;
never executed: halantPos = base + 2;
0
1225 if (halantPos > 0) {
never evaluated: halantPos > 0
0
1226 if(0) printf(" moving halant from %d to %d!", base+1, lastConsonant);
never evaluated: 0
never executed: printf(" moving halant from %d to %d!", base+1, lastConsonant);
0
1227 for (i = halantPos; i < lastConsonant; i++)
never evaluated: i < lastConsonant
0
1228 uc[i] = uc[i+1];
never executed: uc[i] = uc[i+1];
0
1229 uc[lastConsonant] = halant; -
1230 }
never executed: }
0
1231 }
never executed: }
0
1232 Position matra_position = None; -
1233 if (matra > 0)
never evaluated: matra > 0
0
1234 matra_position = indic_position(uc[matra]);
never executed: matra_position = indic_position(uc[matra]);
0
1235 if(0) printf(" matra at %d with form %d, base=%d", matra, matra_position, base);
never evaluated: 0
never executed: printf(" matra at %d with form %d, base=%d", matra, matra_position, base);
0
1236 -
1237 if (beginsWithRa && base != 0) {
never evaluated: beginsWithRa
never evaluated: base != 0
0
1238 int toPos = base+1; -
1239 if (toPos < len && uc[toPos] == nukta)
never evaluated: toPos < len
never evaluated: uc[toPos] == nukta
0
1240 toPos++;
never executed: toPos++;
0
1241 if (toPos < len && uc[toPos] == halant)
never evaluated: toPos < len
never evaluated: uc[toPos] == halant
0
1242 toPos++;
never executed: toPos++;
0
1243 if (toPos < len && uc[toPos] == 0x200d)
never evaluated: toPos < len
never evaluated: uc[toPos] == 0x200d
0
1244 toPos++;
never executed: toPos++;
0
1245 if (toPos < len-1 && uc[toPos] == ra && uc[toPos+1] == halant)
never evaluated: toPos < len-1
never evaluated: uc[toPos] == ra
never evaluated: uc[toPos+1] == halant
0
1246 toPos += 2;
never executed: toPos += 2;
0
1247 if (script == HB_Script_Devanagari || script == HB_Script_Gujarati || script == HB_Script_Bengali) {
never evaluated: script == HB_Script_Devanagari
never evaluated: script == HB_Script_Gujarati
never evaluated: script == HB_Script_Bengali
0
1248 if (matra_position == Post || matra_position == Split) {
never evaluated: matra_position == Post
never evaluated: matra_position == Split
0
1249 toPos = matra+1; -
1250 matra -= 2; -
1251 }
never executed: }
0
1252 } else if (script == HB_Script_Kannada) {
never evaluated: script == HB_Script_Kannada
never executed: }
0
1253 toPos = len; -
1254 matra -= 2; -
1255 }
never executed: }
0
1256 -
1257 if(0) printf("moving leading ra+halant to position %d", toPos);
never evaluated: 0
never executed: printf("moving leading ra+halant to position %d", toPos);
0
1258 for (i = 2; i < toPos; i++)
never evaluated: i < toPos
0
1259 uc[i-2] = uc[i];
never executed: uc[i-2] = uc[i];
0
1260 uc[toPos-2] = ra; -
1261 uc[toPos-1] = halant; -
1262 base -= 2; -
1263 if (properties & HasReph)
never evaluated: properties & HasReph
0
1264 reph = toPos-2;
never executed: reph = toPos-2;
0
1265 }
never executed: }
0
1266 if (matra_position == Split) {
never evaluated: matra_position == Split
0
1267 splitMatra(uc, matra, len); -
1268 -
1269 matra_position = indic_position(uc[matra]); -
1270 }
never executed: }
0
1271 -
1272 if (matra_position == Pre) {
never evaluated: matra_position == Pre
0
1273 unsigned short m = uc[matra]; -
1274 while (matra--)
never evaluated: matra--
0
1275 uc[matra+1] = uc[matra];
never executed: uc[matra+1] = uc[matra];
0
1276 uc[0] = m; -
1277 base++; -
1278 }
never executed: }
0
1279 }
never executed: }
0
1280 -
1281 -
1282 -
1283 -
1284 -
1285 -
1286 -
1287 for (i = 0; i < base; ++i)
never evaluated: i < base
0
1288 position[i] = Pre;
never executed: position[i] = Pre;
0
1289 position[base] = Base; -
1290 for (i = base+1; i < len; ++i) {
never evaluated: i < len
0
1291 position[i] = indic_position(uc[i]); -
1292 -
1293 if (uc[i] == nukta || uc[i] == halant)
never evaluated: uc[i] == nukta
never evaluated: uc[i] == halant
0
1294 position[i] = Inherit;
never executed: position[i] = Inherit;
0
1295 }
never executed: }
0
1296 if (reph > 0) {
never evaluated: reph > 0
0
1297 -
1298 for (i = base+1; i < len; ++i)
never evaluated: i < len
0
1299 if (uc[i] == ra)
never evaluated: uc[i] == ra
0
1300 reph = i;
never executed: reph = i;
0
1301 position[reph] = Reph; -
1302 position[reph+1] = Inherit; -
1303 }
never executed: }
0
1304 -
1305 -
1306 int fixed = base+1; -
1307 if (fixed < len && uc[fixed] == nukta)
never evaluated: fixed < len
never evaluated: uc[fixed] == nukta
0
1308 fixed++;
never executed: fixed++;
0
1309 if (fixed < len && uc[fixed] == halant)
never evaluated: fixed < len
never evaluated: uc[fixed] == halant
0
1310 fixed++;
never executed: fixed++;
0
1311 if (fixed < len && uc[fixed] == 0x200d)
never evaluated: fixed < len
never evaluated: uc[fixed] == 0x200d
0
1312 fixed++;
never executed: fixed++;
0
1313 -
1314 -
1315 -
1316 -
1317 -
1318 -
1319 -
1320 const IndicOrdering *finalOrder = indic_order[script-HB_Script_Devanagari]; -
1321 -
1322 if(0) printf(" reordering pass:");
never evaluated: 0
never executed: printf(" reordering pass:");
0
1323 if(0) printf(" base=%d fixed=%d", base, fixed);
never evaluated: 0
never executed: printf(" base=%d fixed=%d", base, fixed);
0
1324 int toMove = 0; -
1325 while (finalOrder[toMove].form && fixed < len-1) {
never evaluated: finalOrder[toMove].form
never evaluated: fixed < len-1
0
1326 if(0) printf(" fixed = %d, toMove=%d, moving form %d with pos %d", fixed, toMove, finalOrder[toMove].form, finalOrder[toMove].position);
never evaluated: 0
never executed: printf(" fixed = %d, toMove=%d, moving form %d with pos %d", fixed, toMove, finalOrder[toMove].form, finalOrder[toMove].position);
0
1327 for (i = fixed; i < len; i++) {
never evaluated: i < len
0
1328 -
1329 -
1330 if (form(uc[i]) == finalOrder[toMove].form &&
never evaluated: form(uc[i]) == finalOrder[toMove].form
0
1331 position[i] == finalOrder[toMove].position) {
never evaluated: position[i] == finalOrder[toMove].position
0
1332 -
1333 int to = fixed; -
1334 if (i < len-1 && position[i+1] == Inherit) {
never evaluated: i < len-1
never evaluated: position[i+1] == Inherit
0
1335 if(0) printf(" moving two chars from %d to %d", i, to);
never evaluated: 0
never executed: printf(" moving two chars from %d to %d", i, to);
0
1336 unsigned short ch = uc[i]; -
1337 unsigned short ch2 = uc[i+1]; -
1338 unsigned char pos = position[i]; -
1339 for (int j = i+1; j > to+1; j--) {
never evaluated: j > to+1
0
1340 uc[j] = uc[j-2]; -
1341 position[j] = position[j-2]; -
1342 }
never executed: }
0
1343 uc[to] = ch; -
1344 uc[to+1] = ch2; -
1345 position[to] = pos; -
1346 position[to+1] = pos; -
1347 fixed += 2; -
1348 } else {
never executed: }
0
1349 if(0) printf(" moving one char from %d to %d", i, to);
never evaluated: 0
never executed: printf(" moving one char from %d to %d", i, to);
0
1350 unsigned short ch = uc[i]; -
1351 unsigned char pos = position[i]; -
1352 for (int j = i; j > to; j--) {
never evaluated: j > to
0
1353 uc[j] = uc[j-1]; -
1354 position[j] = position[j-1]; -
1355 }
never executed: }
0
1356 uc[to] = ch; -
1357 position[to] = pos; -
1358 fixed++; -
1359 }
never executed: }
0
1360 } -
1361 }
never executed: }
0
1362 toMove++; -
1363 }
never executed: }
0
1364 -
1365 }
never executed: }
0
1366 -
1367 if (reph > 0) {
never evaluated: reph > 0
0
1368 -
1369 for (i = base+1; i < len; ++i)
never evaluated: i < len
0
1370 if (reordered[i] == ra)
never evaluated: reordered[i] == ra
0
1371 reph = i;
never executed: reph = i;
0
1372 }
never executed: }
0
1373 -
1374 -
1375 const int availableGlyphs = item->num_glyphs; -
1376 -
1377 if (!item->font->klass->convertStringToGlyphIndices(item->font, 0
1378 reordered, len, 0
1379 item->glyphs, &item->num_glyphs, 0
1380 item->item.bidiLevel % 2))
never evaluated: !item->font->klass->convertStringToGlyphIndices(item->font, reordered, len, item->glyphs, &item->num_glyphs, item->item.bidiLevel % 2)
0
1381 goto error;
never executed: goto error;
0
1382 -
1383 -
1384 if(0) printf(" base=%d, reph=%d", base, reph);
never evaluated: 0
never executed: printf(" base=%d, reph=%d", base, reph);
0
1385 if(0) printf("reordered:");
never evaluated: 0
never executed: printf("reordered:");
0
1386 for (i = 0; i < len; i++) {
never evaluated: i < len
0
1387 item->attributes[i].mark = false; -
1388 item->attributes[i].clusterStart = false; -
1389 item->attributes[i].justification = 0; -
1390 item->attributes[i].zeroWidth = false; -
1391 if(0) printf(" %d: %4x", i, reordered[i]);
never evaluated: 0
never executed: printf(" %d: %4x", i, reordered[i]);
0
1392 }
never executed: }
0
1393 -
1394 -
1395 -
1396 for (i = 0; i < len; ++i)
never evaluated: i < len
0
1397 control |= (form(reordered[i]) == Control);
never executed: control |= (form(reordered[i]) == Control);
0
1398 -
1399 -
1400 if (openType) {
never evaluated: openType
0
1401 -
1402 -
1403 -
1404 -
1405 -
1406 -
1407 -
1408 unsigned short stackclusters[512]; unsigned short *clusters = stackclusters; if ((len) >= 512) clusters = (unsigned short *)malloc((len) * sizeof(unsigned short));;
never evaluated: (len) >= 512
never executed: clusters = (unsigned short *)malloc((len) * sizeof(unsigned short));
0
1409 unsigned int stackproperties[512]; unsigned int *properties = stackproperties; if ((len) >= 512) properties = (unsigned int *)malloc((len) * sizeof(unsigned int));;
never evaluated: (len) >= 512
never executed: properties = (unsigned int *)malloc((len) * sizeof(unsigned int));
0
1410 -
1411 for (i = 0; i < len; ++i)
never evaluated: i < len
0
1412 clusters[i] = i;
never executed: clusters[i] = i;
0
1413 -
1414 -
1415 for (i = 0; i < len; ++i)
never evaluated: i < len
0
1416 properties[i] = ~(LocaProperty 0
1417 | CcmpProperty 0
1418 | NuktaProperty 0
1419 | VattuProperty 0
1420 | ConjunctFormProperty 0
1421 | PreSubstProperty 0
1422 | BelowSubstProperty 0
1423 | AboveSubstProperty 0
1424 | PostSubstProperty 0
1425 | HalantProperty 0
1426 | IndicCaltProperty 0
1427 | 0x80000000);
never executed: properties[i] = ~(LocaProperty | CcmpProperty | NuktaProperty | VattuProperty | ConjunctFormProperty | PreSubstProperty | BelowSubstProperty | AboveSubstProperty | PostSubstProperty | HalantProperty | IndicCaltProperty | 0x80000000);
0
1428 -
1429 -
1430 -
1431 -
1432 if (item->item.pos == 0
never evaluated: item->item.pos == 0
0
1433 || !(isLetter(item->string[item->item.pos-1]) || isMark(item->string[item->item.pos-1])))
never evaluated: isLetter(item->string[item->item.pos-1])
never evaluated: isMark(item->string[item->item.pos-1])
0
1434 properties[0] &= ~InitProperty;
never executed: properties[0] &= ~InitProperty;
0
1435 -
1436 -
1437 -
1438 for (i = 0; i <= base; ++i)
never evaluated: i <= base
0
1439 properties[i] &= ~AkhantProperty;
never executed: properties[i] &= ~AkhantProperty;
0
1440 -
1441 if (reph >= 0) {
never evaluated: reph >= 0
0
1442 properties[reph] &= ~RephProperty; -
1443 properties[reph+1] &= ~RephProperty; -
1444 }
never executed: }
0
1445 -
1446 for (i = base+1; i < len; ++i)
never evaluated: i < len
0
1447 properties[i] &= ~BelowFormProperty;
never executed: properties[i] &= ~BelowFormProperty;
0
1448 -
1449 if (script == HB_Script_Devanagari || script == HB_Script_Gujarati) {
never evaluated: script == HB_Script_Devanagari
never evaluated: script == HB_Script_Gujarati
0
1450 -
1451 bool vattu = false; -
1452 for (i = base-2; i > 1; --i) {
never evaluated: i > 1
0
1453 if (form(reordered[i]) == Consonant) {
never evaluated: form(reordered[i]) == Consonant
0
1454 vattu = (!vattu && reordered[i] == ra);
never evaluated: !vattu
never evaluated: reordered[i] == ra
0
1455 if (vattu) {
never evaluated: vattu
0
1456 if(0) printf("forming vattu ligature at %d", i);
never evaluated: 0
never executed: printf("forming vattu ligature at %d", i);
0
1457 properties[i] &= ~BelowFormProperty; -
1458 properties[i+1] &= ~BelowFormProperty; -
1459 }
never executed: }
0
1460 }
never executed: }
0
1461 }
never executed: }
0
1462 }
never executed: }
0
1463 -
1464 for (i = 0; i < base; ++i)
never evaluated: i < base
0
1465 properties[i] &= ~HalfFormProperty;
never executed: properties[i] &= ~HalfFormProperty;
0
1466 if (control) {
never evaluated: control
0
1467 for (i = 2; i < len; ++i) {
never evaluated: i < len
0
1468 if (reordered[i] == 0x200d ) {
never evaluated: reordered[i] == 0x200d
0
1469 properties[i-1] &= ~HalfFormProperty; -
1470 properties[i-2] &= ~HalfFormProperty; -
1471 } else if (reordered[i] == 0x200c ) {
never executed: }
never evaluated: reordered[i] == 0x200c
0
1472 properties[i-1] &= ~HalfFormProperty; -
1473 properties[i-2] &= ~HalfFormProperty; -
1474 }
never executed: }
0
1475 } -
1476 }
never executed: }
0
1477 -
1478 for (i = base+1; i < len; ++i)
never evaluated: i < len
0
1479 properties[i] &= ~PostFormProperty;
never executed: properties[i] &= ~PostFormProperty;
0
1480 item->log_clusters = clusters; -
1481 HB_OpenTypeShape(item, properties); -
1482 -
1483 int newLen = item->face->buffer->in_length; -
1484 HB_GlyphItem otl_glyphs = item->face->buffer->in_string; -
1485 -
1486 -
1487 if ((script == HB_Script_Malayalam || script == HB_Script_Tamil) && (form(reordered[0]) == Matra)) {
never evaluated: script == HB_Script_Malayalam
never evaluated: script == HB_Script_Tamil
never evaluated: (form(reordered[0]) == Matra)
0
1488 -
1489 -
1490 int basePos = 0; -
1491 while (basePos < newLen && (int)otl_glyphs[basePos].cluster <= base)
never evaluated: basePos < newLen
never evaluated: (int)otl_glyphs[basePos].cluster <= base
0
1492 basePos++;
never executed: basePos++;
0
1493 --basePos; -
1494 if (basePos < newLen && basePos > 1) {
never evaluated: basePos < newLen
never evaluated: basePos > 1
0
1495 -
1496 HB_GlyphItemRec m = otl_glyphs[0]; -
1497 --basePos; -
1498 for (i = 0; i < basePos; ++i)
never evaluated: i < basePos
0
1499 otl_glyphs[i] = otl_glyphs[i+1];
never executed: otl_glyphs[i] = otl_glyphs[i+1];
0
1500 otl_glyphs[basePos] = m; -
1501 }
never executed: }
0
1502 }
never executed: }
0
1503 -
1504 HB_Bool positioned = HB_OpenTypePosition(item, availableGlyphs, false); -
1505 -
1506 if (stackclusters != clusters) free(clusters);;
never executed: free(clusters);
never evaluated: stackclusters != clusters
0
1507 if (stackproperties != properties) free(properties);;
never executed: free(properties);
never evaluated: stackproperties != properties
0
1508 -
1509 if (!positioned)
never evaluated: !positioned
0
1510 goto error;
never executed: goto error;
0
1511 -
1512 if (control) {
never evaluated: control
0
1513 if(0) printf("found a control char in the syllable");
never executed: printf("found a control char in the syllable");
never evaluated: 0
0
1514 hb_uint32 i = 0, j = 0; -
1515 while (i < item->num_glyphs) {
never evaluated: i < item->num_glyphs
0
1516 if (form(reordered[otl_glyphs[i].cluster]) == Control) {
never evaluated: form(reordered[otl_glyphs[i].cluster]) == Control
0
1517 ++i; -
1518 if (i >= item->num_glyphs)
never evaluated: i >= item->num_glyphs
0
1519 break;
never executed: break;
0
1520 }
never executed: }
0
1521 item->glyphs[j] = item->glyphs[i]; -
1522 item->attributes[j] = item->attributes[i]; -
1523 item->advances[j] = item->advances[i]; -
1524 ++i; -
1525 ++j; -
1526 }
never executed: }
0
1527 item->num_glyphs = j; -
1528 }
never executed: }
0
1529 -
1530 } else {
never executed: }
0
1531 HB_HeuristicPosition(item); -
1532 }
never executed: }
0
1533 -
1534 item->attributes[0].clusterStart = true; -
1535 -
1536 if (stackreordered != reordered) free(reordered);;
never executed: free(reordered);
never evaluated: stackreordered != reordered
0
1537 if (stackposition != position) free(position);;
never executed: free(position);
never evaluated: stackposition != position
0
1538 -
1539 if(0) printf("<<<<<<");
never executed: printf("<<<<<<");
never evaluated: 0
0
1540 return true;
never executed: return true;
0
1541 -
1542error: -
1543 if (stackreordered != reordered) free(reordered);;
never executed: free(reordered);
never evaluated: stackreordered != reordered
0
1544 if (stackposition != position) free(position);;
never executed: free(position);
never evaluated: stackposition != position
0
1545 return false;
never executed: return false;
0
1546} -
1547static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int start, int end, bool *invalid) -
1548{ -
1549 *invalid = false; -
1550 if(0) printf("indic_nextSyllableBoundary: start=%d, end=%d", start, end);
never executed: printf("indic_nextSyllableBoundary: start=%d, end=%d", start, end);
never evaluated: 0
0
1551 const HB_UChar16 *uc = s+start; -
1552 -
1553 int pos = 0; -
1554 Form state = form(uc[pos]); -
1555 if(0) printf("state[%d]=%d (uc=%4x)", pos, state, uc[pos]);
never executed: printf("state[%d]=%d (uc=%4x)", pos, state, uc[pos]);
never evaluated: 0
0
1556 pos++; -
1557 -
1558 if (state != Consonant && state != IndependentVowel) {
never evaluated: state != Consonant
never evaluated: state != IndependentVowel
0
1559 if (state != Other)
never evaluated: state != Other
0
1560 *invalid = true;
never executed: *invalid = true;
0
1561 goto finish;
never executed: goto finish;
0
1562 } -
1563 -
1564 while (pos < end - start) {
never evaluated: pos < end - start
0
1565 Form newState = form(uc[pos]); -
1566 if(0) printf("state[%d]=%d (uc=%4x)", pos, newState, uc[pos]);
never executed: printf("state[%d]=%d (uc=%4x)", pos, newState, uc[pos]);
never evaluated: 0
0
1567 switch(newState) { -
1568 case Control: -
1569 newState = state; -
1570 if (state == Halant && uc[pos] == 0x200d )
never evaluated: state == Halant
never evaluated: uc[pos] == 0x200d
0
1571 break;
never executed: break;
0
1572 -
1573 if (state == Consonant && script == HB_Script_Bengali && uc[pos-1] == 0x09B0 && uc[pos] == 0x200d )
never evaluated: state == Consonant
never evaluated: script == HB_Script_Bengali
never evaluated: uc[pos-1] == 0x09B0
never evaluated: uc[pos] == 0x200d
0
1574 break;
never executed: break;
0
1575 if (state == Consonant && script == HB_Script_Kannada && uc[pos-1] == 0x0CB0 && uc[pos] == 0x200d )
never evaluated: state == Consonant
never evaluated: script == HB_Script_Kannada
never evaluated: uc[pos-1] == 0x0CB0
never evaluated: uc[pos] == 0x200d
0
1576 break;
never executed: break;
0
1577 -
1578 ++pos; -
1579 goto finish;
never executed: goto finish;
0
1580 case Consonant: -
1581 if (state == Halant && (script != HB_Script_Sinhala || uc[pos-1] == 0x200d ))
never evaluated: state == Halant
never evaluated: script != HB_Script_Sinhala
never evaluated: uc[pos-1] == 0x200d
0
1582 break;
never executed: break;
0
1583 goto finish;
never executed: goto finish;
0
1584 case Halant: -
1585 if (state == Nukta || state == Consonant)
never evaluated: state == Nukta
never evaluated: state == Consonant
0
1586 break;
never executed: break;
0
1587 -
1588 if (script == HB_Script_Bengali && pos == 1 &&
never evaluated: script == HB_Script_Bengali
never evaluated: pos == 1
0
1589 (uc[0] == 0x0985 || uc[0] == 0x098f))
never evaluated: uc[0] == 0x0985
never evaluated: uc[0] == 0x098f
0
1590 break;
never executed: break;
0
1591 -
1592 if (script == HB_Script_Sinhala && state == Matra) {
never evaluated: script == HB_Script_Sinhala
never evaluated: state == Matra
0
1593 ++pos; -
1594 continue;
never executed: continue;
0
1595 } -
1596 if (script == HB_Script_Malayalam && state == Matra && uc[pos-1] == 0x0d41) {
never evaluated: script == HB_Script_Malayalam
never evaluated: state == Matra
never evaluated: uc[pos-1] == 0x0d41
0
1597 ++pos; -
1598 continue;
never executed: continue;
0
1599 } -
1600 goto finish;
never executed: goto finish;
0
1601 case Nukta: -
1602 if (state == Consonant)
never evaluated: state == Consonant
0
1603 break;
never executed: break;
0
1604 goto finish;
never executed: goto finish;
0
1605 case StressMark: -
1606 if (state == VowelMark)
never evaluated: state == VowelMark
0
1607 break;
never executed: break;
0
1608 -
1609 case VowelMark:
code before this statement never executed: case VowelMark:
0
1610 if (state == Matra || state == LengthMark || state == IndependentVowel)
never evaluated: state == Matra
never evaluated: state == LengthMark
never evaluated: state == IndependentVowel
0
1611 break;
never executed: break;
0
1612 -
1613 case Matra:
code before this statement never executed: case Matra:
0
1614 if (state == Consonant || state == Nukta)
never evaluated: state == Consonant
never evaluated: state == Nukta
0
1615 break;
never executed: break;
0
1616 if (state == Matra) {
never evaluated: state == Matra
0
1617 -
1618 break;
never executed: break;
0
1619 } -
1620 -
1621 -
1622 -
1623 if (script == HB_Script_Bengali && uc[pos] == 0x9be && uc[pos-1] == 0x985)
never evaluated: script == HB_Script_Bengali
never evaluated: uc[pos] == 0x9be
never evaluated: uc[pos-1] == 0x985
0
1624 break;
never executed: break;
0
1625 if (script == HB_Script_Tamil && state == Matra) {
never evaluated: script == HB_Script_Tamil
never evaluated: state == Matra
0
1626 if (uc[pos-1] == 0x0bc6 &&
never evaluated: uc[pos-1] == 0x0bc6
0
1627 (uc[pos] == 0xbbe || uc[pos] == 0xbd7))
never evaluated: uc[pos] == 0xbbe
never evaluated: uc[pos] == 0xbd7
0
1628 break;
never executed: break;
0
1629 if (uc[pos-1] == 0x0bc7 && uc[pos] == 0xbbe)
never evaluated: uc[pos-1] == 0x0bc7
never evaluated: uc[pos] == 0xbbe
0
1630 break;
never executed: break;
0
1631 }
never executed: }
0
1632 goto finish;
never executed: goto finish;
0
1633 -
1634 case LengthMark: -
1635 if (state == Matra) {
never evaluated: state == Matra
0
1636 -
1637 break;
never executed: break;
0
1638 } -
1639 case IndependentVowel: -
1640 case Invalid: -
1641 case Other: -
1642 goto finish;
never executed: goto finish;
0
1643 } -
1644 state = newState; -
1645 pos++; -
1646 }
never executed: }
0
1647 finish: -
1648 return pos+start;
never executed: return pos+start;
0
1649} -
1650 -
1651HB_Bool HB_IndicShape(HB_ShaperItem *item) -
1652{ -
1653 ((item->item.script >= HB_Script_Devanagari && item->item.script <= HB_Script_Sinhala) ? static_cast<void> (0) : __assert_fail ("item->item.script >= HB_Script_Devanagari && item->item.script <= HB_Script_Sinhala", "../3rdparty/harfbuzz/src/harfbuzz-indic.cpp", 1825, __PRETTY_FUNCTION__)); -
1654 -
1655 HB_Bool openType = false; -
1656 -
1657 openType = HB_SelectScript(item, indic_features); -
1658 -
1659 unsigned short *logClusters = item->log_clusters; -
1660 -
1661 HB_ShaperItem syllable = *item; -
1662 int first_glyph = 0; -
1663 -
1664 int sstart = item->item.pos; -
1665 int end = sstart + item->item.length; -
1666 if(0) printf("indic_shape: from %d length %d", item->item.pos, item->item.length);
never executed: printf("indic_shape: from %d length %d", item->item.pos, item->item.length);
never evaluated: 0
0
1667 while (sstart < end) {
never evaluated: sstart < end
0
1668 bool invalid; -
1669 int send = indic_nextSyllableBoundary(item->item.script, item->string, sstart, end, &invalid); -
1670 if(0) printf("syllable from %d, length %d, invalid=%s", sstart, send-sstart,
never evaluated: 0
0
1671 invalid ? "true" : "false");
never executed: printf("syllable from %d, length %d, invalid=%s", sstart, send-sstart, invalid ? "true" : "false");
0
1672 syllable.item.pos = sstart; -
1673 syllable.item.length = send-sstart; -
1674 syllable.glyphs = item->glyphs + first_glyph; -
1675 syllable.attributes = item->attributes + first_glyph; -
1676 syllable.offsets = item->offsets + first_glyph; -
1677 syllable.advances = item->advances + first_glyph; -
1678 syllable.num_glyphs = item->num_glyphs - first_glyph; -
1679 if (!indic_shape_syllable(openType, &syllable, invalid)) {
never evaluated: !indic_shape_syllable(openType, &syllable, invalid)
0
1680 if(0) printf("syllable shaping failed, syllable requests %d glyphs", syllable.num_glyphs);
never executed: printf("syllable shaping failed, syllable requests %d glyphs", syllable.num_glyphs);
never evaluated: 0
0
1681 item->num_glyphs += syllable.num_glyphs; -
1682 return false;
never executed: return false;
0
1683 } -
1684 -
1685 if(0) printf("syllable:");
never executed: printf("syllable:");
never evaluated: 0
0
1686 hb_uint32 g; -
1687 for (g = first_glyph; g < first_glyph + syllable.num_glyphs; ++g)
never evaluated: g < first_glyph + syllable.num_glyphs
0
1688 if(0) printf(" %d -> glyph %x", g, item->glyphs[g]);
never executed: printf(" %d -> glyph %x", g, item->glyphs[g]);
never evaluated: 0
0
1689 if(0) printf(" logclusters:");
never executed: printf(" logclusters:");
never evaluated: 0
0
1690 int i; -
1691 for (i = sstart; i < send; ++i) {
never evaluated: i < send
0
1692 if(0) printf(" %d -> glyph %d", i, first_glyph);
never executed: printf(" %d -> glyph %d", i, first_glyph);
never evaluated: 0
0
1693 logClusters[i-item->item.pos] = first_glyph; -
1694 }
never executed: }
0
1695 sstart = send; -
1696 first_glyph += syllable.num_glyphs; -
1697 }
never executed: }
0
1698 item->num_glyphs = first_glyph; -
1699 return true;
never executed: return true;
0
1700} -
1701 -
1702void HB_IndicAttributes(HB_Script script, const HB_UChar16 *text, hb_uint32 from, hb_uint32 len, HB_CharAttributes *attributes) -
1703{ -
1704 int end = from + len; -
1705 const HB_UChar16 *uc = text + from; -
1706 attributes += from; -
1707 hb_uint32 i = 0; -
1708 while (i < len) {
never evaluated: i < len
0
1709 bool invalid; -
1710 hb_uint32 boundary = indic_nextSyllableBoundary(script, text, from+i, end, &invalid) - from; -
1711 attributes[i].graphemeBoundary = true; -
1712 -
1713 if (boundary > len-1) boundary = len;
never executed: boundary = len;
never evaluated: boundary > len-1
0
1714 i++; -
1715 while (i < boundary) {
never evaluated: i < boundary
0
1716 attributes[i].graphemeBoundary = false; -
1717 ++uc; -
1718 ++i; -
1719 }
never executed: }
0
1720 ((i == boundary) ? static_cast<void> (0) : __assert_fail ("i == boundary", "../3rdparty/harfbuzz/src/harfbuzz-indic.cpp", 1892, __PRETTY_FUNCTION__)); -
1721 }
never executed: }
0
1722 -
1723 -
1724}
never executed: }
0
1725 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial