Line | Source Code | Coverage |
---|
1 | | - | 2 | static const HB_UChar16 ReplacementCharacter = 0xfffd; | - | 3 | | - | 4 | typedef struct { | - | 5 | unsigned char shape; | - | 6 | unsigned char justification; | - | 7 | } HB_ArabicProperties; | - | 8 | | - | 9 | typedef enum { | - | 10 | XIsolated, | - | 11 | XFinal, | - | 12 | XInitial, | - | 13 | XMedial, | - | 14 | | - | 15 | XCausing | - | 16 | } ArabicShape; | - | 17 | typedef enum { | - | 18 | | - | 19 | ArabicNone, | - | 20 | ArabicSpace, | - | 21 | | - | 22 | Transparent, | - | 23 | | - | 24 | Center, | - | 25 | Kashida, | - | 26 | | - | 27 | | - | 28 | | - | 29 | Beh, | - | 30 | Noon, | - | 31 | Nya = Noon, | - | 32 | Meem = Noon, | - | 33 | Heh = Noon, | - | 34 | KnottedHeh = Noon, | - | 35 | HehGoal = Noon, | - | 36 | SwashKaf = Noon, | - | 37 | Yeh, | - | 38 | FarsiYeh = Yeh, | - | 39 | Hah, | - | 40 | Seen, | - | 41 | Sad = Seen, | - | 42 | Tah, | - | 43 | Kaf = Tah, | - | 44 | Gaf = Tah, | - | 45 | Lam = Tah, | - | 46 | Ain, | - | 47 | Feh = Ain, | - | 48 | Qaf = Ain, | - | 49 | | - | 50 | Alef, | - | 51 | Waw, | - | 52 | Dal, | - | 53 | TehMarbuta = Dal, | - | 54 | Reh, | - | 55 | TehMarbutaGoal, | - | 56 | HamzaOnHehGoal = TehMarbutaGoal, | - | 57 | YehWithTail = TehMarbutaGoal, | - | 58 | YehBarree = TehMarbutaGoal, | - | 59 | | - | 60 | | - | 61 | | - | 62 | Beth = Beh, | - | 63 | Gamal = Ain, | - | 64 | Heth = Noon, | - | 65 | Teth = Hah, | - | 66 | Yudh = Noon, | - | 67 | Khaph = Noon, | - | 68 | Lamadh = Lam, | - | 69 | Mim = Noon, | - | 70 | Nun = Noon, | - | 71 | Semkath = Noon, | - | 72 | FinalSemkath = Noon, | - | 73 | SyriacE = Ain, | - | 74 | Pe = Ain, | - | 75 | ReversedPe = Hah, | - | 76 | Qaph = Noon, | - | 77 | Shin = Noon, | - | 78 | Fe = Ain, | - | 79 | | - | 80 | | - | 81 | Alaph = Alef, | - | 82 | DalathRish = Dal, | - | 83 | He = Dal, | - | 84 | SyriacWaw = Waw, | - | 85 | Zhain = Alef, | - | 86 | YudhHe = Waw, | - | 87 | Sadhe = TehMarbutaGoal, | - | 88 | Taw = Dal, | - | 89 | | - | 90 | | - | 91 | Dummy = TehMarbutaGoal, | - | 92 | ArabicGroupsEnd | - | 93 | } ArabicGroup; | - | 94 | | - | 95 | static const unsigned char arabic_group[0x150] = { | - | 96 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 97 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 98 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 99 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 100 | | - | 101 | Transparent, Transparent, Transparent, Transparent, | - | 102 | Transparent, Transparent, Transparent, Transparent, | - | 103 | Transparent, Transparent, Transparent, ArabicNone, | - | 104 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 105 | | - | 106 | Yeh, ArabicNone, Alef, Alef, | - | 107 | Waw, Alef, Yeh, Alef, | - | 108 | Beh, TehMarbuta, Beh, Beh, | - | 109 | Hah, Hah, Hah, Dal, | - | 110 | | - | 111 | Dal, Reh, Reh, Seen, | - | 112 | Seen, Sad, Sad, Tah, | - | 113 | Tah, Ain, Ain, Gaf, | - | 114 | Gaf, FarsiYeh, FarsiYeh, FarsiYeh, | - | 115 | | - | 116 | | - | 117 | Kashida, Feh, Qaf, Kaf, | - | 118 | Lam, Meem, Noon, Heh, | - | 119 | Waw, Yeh, Yeh, Transparent, | - | 120 | Transparent, Transparent, Transparent, Transparent, | - | 121 | | - | 122 | Transparent, Transparent, Transparent, Transparent, | - | 123 | Transparent, Transparent, Transparent, Transparent, | - | 124 | Transparent, Transparent, Transparent, Transparent, | - | 125 | Transparent, Transparent, Transparent, Transparent, | - | 126 | | - | 127 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 128 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 129 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 130 | ArabicNone, ArabicNone, Beh, Qaf, | - | 131 | | - | 132 | Transparent, Alef, Alef, Alef, | - | 133 | ArabicNone, Alef, Waw, Waw, | - | 134 | Yeh, Beh, Beh, Beh, | - | 135 | Beh, Beh, Beh, Beh, | - | 136 | | - | 137 | | - | 138 | Beh, Hah, Hah, Hah, | - | 139 | Hah, Hah, Hah, Hah, | - | 140 | Dal, Dal, Dal, Dal, | - | 141 | Dal, Dal, Dal, Dal, | - | 142 | | - | 143 | Dal, Reh, Reh, Reh, | - | 144 | Reh, Reh, Reh, Reh, | - | 145 | Reh, Reh, Seen, Seen, | - | 146 | Seen, Sad, Sad, Tah, | - | 147 | | - | 148 | Ain, Feh, Feh, Feh, | - | 149 | Feh, Feh, Feh, Qaf, | - | 150 | Qaf, Gaf, SwashKaf, Gaf, | - | 151 | Kaf, Kaf, Kaf, Gaf, | - | 152 | | - | 153 | Gaf, Gaf, Gaf, Gaf, | - | 154 | Gaf, Lam, Lam, Lam, | - | 155 | Lam, Noon, Noon, Noon, | - | 156 | Noon, Nya, KnottedHeh, Hah, | - | 157 | | - | 158 | | - | 159 | TehMarbuta, HehGoal, HehGoal, TehMarbutaGoal, | - | 160 | Waw, Waw, Waw, Waw, | - | 161 | Waw, Waw, Waw, Waw, | - | 162 | FarsiYeh, YehWithTail, FarsiYeh, Waw, | - | 163 | | - | 164 | Yeh, Yeh, YehBarree, YehBarree, | - | 165 | ArabicNone, TehMarbuta, Transparent, Transparent, | - | 166 | Transparent, Transparent, Transparent, Transparent, | - | 167 | Transparent, ArabicNone, ArabicNone, Transparent, | - | 168 | | - | 169 | Transparent, Transparent, Transparent, Transparent, | - | 170 | Transparent, ArabicNone, ArabicNone, Transparent, | - | 171 | Transparent, ArabicNone, Transparent, Transparent, | - | 172 | Transparent, Transparent, Dal, Reh, | - | 173 | | - | 174 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 175 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 176 | ArabicNone, ArabicNone, Seen, Sad, | - | 177 | Ain, ArabicNone, ArabicNone, KnottedHeh, | - | 178 | | - | 179 | | - | 180 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 181 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 182 | ArabicNone, ArabicNone, ArabicNone, ArabicNone, | - | 183 | ArabicNone, ArabicNone, ArabicNone, Transparent, | - | 184 | | - | 185 | Alaph, Transparent, Beth, Gamal, | - | 186 | Gamal, DalathRish, DalathRish, He, | - | 187 | SyriacWaw, Zhain, Heth, Teth, | - | 188 | Teth, Yudh, YudhHe, Khaph, | - | 189 | | - | 190 | Lamadh, Mim, Nun, Semkath, | - | 191 | FinalSemkath, SyriacE, Pe, ReversedPe, | - | 192 | Sadhe, Qaph, DalathRish, Shin, | - | 193 | Taw, Beth, Gamal, DalathRish, | - | 194 | | - | 195 | Transparent, Transparent, Transparent, Transparent, | - | 196 | Transparent, Transparent, Transparent, Transparent, | - | 197 | Transparent, Transparent, Transparent, Transparent, | - | 198 | Transparent, Transparent, Transparent, Transparent, | - | 199 | | - | 200 | Transparent, Transparent, Transparent, Transparent, | - | 201 | Transparent, Transparent, Transparent, Transparent, | - | 202 | Transparent, Transparent, Transparent, ArabicNone, | - | 203 | ArabicNone, Zhain, Khaph, Fe, | - | 204 | }; | - | 205 | | - | 206 | static ArabicGroup arabicGroup(unsigned short uc) | - | 207 | { | - | 208 | if (uc >= 0x0600 && uc < 0x750) evaluated: uc >= 0x0600 yes Evaluation Count:196 | yes Evaluation Count:75 |
partially evaluated: uc < 0x750 yes Evaluation Count:196 | no Evaluation Count:0 |
| 0-196 | 209 | return (ArabicGroup) arabic_group[uc-0x600]; executed: return (ArabicGroup) arabic_group[uc-0x600]; Execution Count:196 | 196 | 210 | else if (uc == 0x200d) partially evaluated: uc == 0x200d no Evaluation Count:0 | yes Evaluation Count:75 |
| 0-75 | 211 | return Center; never executed: return Center; | 0 | 212 | else if (HB_GetUnicodeCharCategory(uc) == HB_Separator_Space) evaluated: HB_GetUnicodeCharCategory(uc) == HB_Separator_Space yes Evaluation Count:65 | yes Evaluation Count:10 |
| 10-65 | 213 | return ArabicSpace; executed: return ArabicSpace; Execution Count:65 | 65 | 214 | else | - | 215 | return ArabicNone; executed: return ArabicNone; Execution Count:10 | 10 | 216 | } | - | 217 | typedef enum { | - | 218 | JNone, | - | 219 | JCausing, | - | 220 | JDual, | - | 221 | JRight, | - | 222 | JTransparent | - | 223 | } Joining; | - | 224 | | - | 225 | static const Joining joining_for_group[ArabicGroupsEnd] = { | - | 226 | | - | 227 | JNone, | - | 228 | JNone, | - | 229 | | - | 230 | JTransparent, | - | 231 | | - | 232 | JCausing, | - | 233 | JCausing, | - | 234 | | - | 235 | JDual, | - | 236 | JDual, | - | 237 | JDual, | - | 238 | JDual, | - | 239 | JDual, | - | 240 | JDual, | - | 241 | JDual, | - | 242 | | - | 243 | JRight, | - | 244 | JRight, | - | 245 | JRight, | - | 246 | JRight, | - | 247 | JRight | - | 248 | }; | - | 249 | | - | 250 | | - | 251 | typedef struct { | - | 252 | ArabicShape form1; | - | 253 | ArabicShape form2; | - | 254 | } JoiningPair; | - | 255 | | - | 256 | static const JoiningPair joining_table[5][4] = | - | 257 | | - | 258 | { | - | 259 | { { XIsolated, XIsolated }, { XIsolated, XCausing }, { XIsolated, XInitial }, { XIsolated, XIsolated } }, | - | 260 | { { XFinal, XIsolated }, { XFinal, XCausing }, { XFinal, XInitial }, { XFinal, XIsolated } }, | - | 261 | { { XIsolated, XIsolated }, { XInitial, XCausing }, { XInitial, XMedial }, { XInitial, XFinal } }, | - | 262 | { { XFinal, XIsolated }, { XMedial, XCausing }, { XMedial, XMedial }, { XMedial, XFinal } }, | - | 263 | { { XIsolated, XIsolated }, { XIsolated, XCausing }, { XIsolated, XMedial }, { XIsolated, XFinal } }, | - | 264 | }; | - | 265 | static void getArabicProperties(const unsigned short *chars, int len, HB_ArabicProperties *properties) | - | 266 | { | - | 267 | | - | 268 | int lastPos = 0; | - | 269 | int lastGroup = ArabicNone; | - | 270 | int i = 0; | - | 271 | | - | 272 | ArabicGroup group = arabicGroup(chars[0]); | - | 273 | Joining j = joining_for_group[group]; | - | 274 | ArabicShape shape = joining_table[XIsolated][j].form2; | - | 275 | properties[0].justification = HB_NoJustification; | - | 276 | | - | 277 | for (i = 1; i < len; ++i) { evaluated: i < len yes Evaluation Count:204 | yes Evaluation Count:57 |
| 57-204 | 278 | | - | 279 | properties[i].justification = HB_NoJustification; | - | 280 | | - | 281 | group = arabicGroup(chars[i]); | - | 282 | j = joining_for_group[group]; | - | 283 | | - | 284 | if (j == JTransparent) { partially evaluated: j == JTransparent no Evaluation Count:0 | yes Evaluation Count:204 |
| 0-204 | 285 | properties[i].shape = XIsolated; | - | 286 | continue; never executed: continue; | 0 | 287 | } | - | 288 | | - | 289 | properties[lastPos].shape = joining_table[shape][j].form1; | - | 290 | shape = joining_table[shape][j].form2; | - | 291 | | - | 292 | switch(lastGroup) { | - | 293 | case Seen: | - | 294 | if (properties[lastPos].shape == XInitial || properties[lastPos].shape == XMedial) partially evaluated: properties[lastPos].shape == XInitial yes Evaluation Count:4 | no Evaluation Count:0 |
never evaluated: properties[lastPos].shape == XMedial | 0-4 | 295 | properties[i-1].justification = HB_Arabic_Seen; executed: properties[i-1].justification = HB_Arabic_Seen; Execution Count:4 | 4 | 296 | break; executed: break; Execution Count:4 | 4 | 297 | case Hah: | - | 298 | if (properties[lastPos].shape == XFinal) evaluated: properties[lastPos].shape == XFinal yes Evaluation Count:4 | yes Evaluation Count:16 |
| 4-16 | 299 | properties[lastPos-1].justification = HB_Arabic_HaaDal; executed: properties[lastPos-1].justification = HB_Arabic_HaaDal; Execution Count:4 | 4 | 300 | break; executed: break; Execution Count:20 | 20 | 301 | case Alef: | - | 302 | if (properties[lastPos].shape == XFinal) evaluated: properties[lastPos].shape == XFinal yes Evaluation Count:12 | yes Evaluation Count:31 |
| 12-31 | 303 | properties[lastPos-1].justification = HB_Arabic_Alef; executed: properties[lastPos-1].justification = HB_Arabic_Alef; Execution Count:12 | 12 | 304 | break; executed: break; Execution Count:43 | 43 | 305 | case Ain: | - | 306 | if (properties[lastPos].shape == XFinal) evaluated: properties[lastPos].shape == XFinal yes Evaluation Count:8 | yes Evaluation Count:9 |
| 8-9 | 307 | properties[lastPos-1].justification = HB_Arabic_Waw; executed: properties[lastPos-1].justification = HB_Arabic_Waw; Execution Count:8 | 8 | 308 | break; executed: break; Execution Count:17 | 17 | 309 | case Noon: | - | 310 | if (properties[lastPos].shape == XFinal) evaluated: properties[lastPos].shape == XFinal yes Evaluation Count:10 | yes Evaluation Count:18 |
| 10-18 | 311 | properties[lastPos-1].justification = HB_Arabic_Normal; executed: properties[lastPos-1].justification = HB_Arabic_Normal; Execution Count:10 | 10 | 312 | break; executed: break; Execution Count:28 | 28 | 313 | case ArabicNone: | - | 314 | break; executed: break; Execution Count:92 | 92 | 315 | | - | 316 | default: | - | 317 | ((0) ? static_cast<void> (0) : __assert_fail ("0", "../3rdparty/harfbuzz/src/harfbuzz-arabic.c", 433, __PRETTY_FUNCTION__)); | - | 318 | } | 0 | 319 | | - | 320 | lastGroup = ArabicNone; | - | 321 | | - | 322 | switch(group) { | - | 323 | case ArabicNone: | - | 324 | case Transparent: | - | 325 | | - | 326 | case Center: | - | 327 | break; executed: break; Execution Count:19 | 19 | 328 | case ArabicSpace: | - | 329 | properties[i].justification = HB_Arabic_Space; | - | 330 | break; executed: break; Execution Count:34 | 34 | 331 | case Kashida: | - | 332 | properties[i].justification = HB_Arabic_Kashida; | - | 333 | break; | 0 | 334 | case Seen: | - | 335 | lastGroup = Seen; | - | 336 | break; executed: break; Execution Count:4 | 4 | 337 | | - | 338 | case Hah: | - | 339 | case Dal: | - | 340 | lastGroup = Hah; | - | 341 | break; executed: break; Execution Count:20 | 20 | 342 | | - | 343 | case Alef: | - | 344 | case Tah: | - | 345 | lastGroup = Alef; | - | 346 | break; executed: break; Execution Count:43 | 43 | 347 | | - | 348 | case Yeh: | - | 349 | case Reh: | - | 350 | if (properties[lastPos].shape == XMedial && arabicGroup(chars[lastPos]) == Beh) evaluated: properties[lastPos].shape == XMedial yes Evaluation Count:10 | yes Evaluation Count:16 |
partially evaluated: arabicGroup(chars[lastPos]) == Beh no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-16 | 351 | properties[lastPos-1].justification = HB_Arabic_BaRa; never executed: properties[lastPos-1].justification = HB_Arabic_BaRa; | 0 | 352 | break; executed: break; Execution Count:26 | 26 | 353 | | - | 354 | case Ain: | - | 355 | case Waw: | - | 356 | lastGroup = Ain; | - | 357 | break; executed: break; Execution Count:21 | 21 | 358 | | - | 359 | case Noon: | - | 360 | case Beh: | - | 361 | case TehMarbutaGoal: | - | 362 | lastGroup = Noon; | - | 363 | break; executed: break; Execution Count:37 | 37 | 364 | case ArabicGroupsEnd: | - | 365 | ((0) ? static_cast<void> (0) : __assert_fail ("0", "../3rdparty/harfbuzz/src/harfbuzz-arabic.c", 481, __PRETTY_FUNCTION__)); | - | 366 | } | 0 | 367 | | - | 368 | lastPos = i; | - | 369 | } executed: } Execution Count:204 | 204 | 370 | properties[lastPos].shape = joining_table[shape][JNone].form1; | - | 371 | | - | 372 | | - | 373 | | - | 374 | | - | 375 | | - | 376 | | - | 377 | } executed: } Execution Count:57 | 57 | 378 | | - | 379 | static Joining getNkoJoining(unsigned short uc) | - | 380 | { | - | 381 | if (uc < 0x7ca) never evaluated: uc < 0x7ca | 0 | 382 | return JNone; never executed: return JNone; | 0 | 383 | if (uc <= 0x7ea) never evaluated: uc <= 0x7ea | 0 | 384 | return JDual; never executed: return JDual; | 0 | 385 | if (uc <= 0x7f3) never evaluated: uc <= 0x7f3 | 0 | 386 | return JTransparent; never executed: return JTransparent; | 0 | 387 | if (uc <= 0x7f9) never evaluated: uc <= 0x7f9 | 0 | 388 | return JNone; never executed: return JNone; | 0 | 389 | if (uc == 0x7fa) never evaluated: uc == 0x7fa | 0 | 390 | return JCausing; never executed: return JCausing; | 0 | 391 | return JNone; never executed: return JNone; | 0 | 392 | } | - | 393 | | - | 394 | static void getNkoProperties(const unsigned short *chars, int len, HB_ArabicProperties *properties) | - | 395 | { | - | 396 | int lastPos = 0; | - | 397 | int i = 0; | - | 398 | | - | 399 | Joining j = getNkoJoining(chars[0]); | - | 400 | ArabicShape shape = joining_table[XIsolated][j].form2; | - | 401 | properties[0].justification = HB_NoJustification; | - | 402 | | - | 403 | for (i = 1; i < len; ++i) { | 0 | 404 | properties[i].justification = (HB_GetUnicodeCharCategory(chars[i]) == HB_Separator_Space) ? never evaluated: (HB_GetUnicodeCharCategory(chars[i]) == HB_Separator_Space) | 0 | 405 | ArabicSpace : ArabicNone; | - | 406 | | - | 407 | j = getNkoJoining(chars[i]); | - | 408 | | - | 409 | if (j == JTransparent) { never evaluated: j == JTransparent | 0 | 410 | properties[i].shape = XIsolated; | - | 411 | continue; never executed: continue; | 0 | 412 | } | - | 413 | | - | 414 | properties[lastPos].shape = joining_table[shape][j].form1; | - | 415 | shape = joining_table[shape][j].form2; | - | 416 | | - | 417 | | - | 418 | lastPos = i; | - | 419 | } | 0 | 420 | properties[lastPos].shape = joining_table[shape][JNone].form1; | - | 421 | | - | 422 | | - | 423 | | - | 424 | | - | 425 | | - | 426 | | - | 427 | } | 0 | 428 | | - | 429 | | - | 430 | | - | 431 | | - | 432 | | - | 433 | | - | 434 | static const hb_uint16 arabicUnicodeMapping[256][2] = { | - | 435 | | - | 436 | | - | 437 | | - | 438 | | - | 439 | | - | 440 | | - | 441 | { 0x0600, 0 }, | - | 442 | { 0x0601, 0 }, | - | 443 | { 0x0602, 0 }, | - | 444 | { 0x0603, 0 }, | - | 445 | { 0x0604, 0 }, | - | 446 | { 0x0605, 0 }, | - | 447 | { 0x0606, 0 }, | - | 448 | { 0x0607, 0 }, | - | 449 | { 0x0608, 0 }, | - | 450 | { 0x0609, 0 }, | - | 451 | { 0x060A, 0 }, | - | 452 | { 0x060B, 0 }, | - | 453 | { 0x060C, 0 }, | - | 454 | { 0x060D, 0 }, | - | 455 | { 0x060E, 0 }, | - | 456 | { 0x060F, 0 }, | - | 457 | | - | 458 | { 0x0610, 0 }, | - | 459 | { 0x0611, 0 }, | - | 460 | { 0x0612, 0 }, | - | 461 | { 0x0613, 0 }, | - | 462 | { 0x0614, 0 }, | - | 463 | { 0x0615, 0 }, | - | 464 | { 0x0616, 0 }, | - | 465 | { 0x0617, 0 }, | - | 466 | { 0x0618, 0 }, | - | 467 | { 0x0619, 0 }, | - | 468 | { 0x061A, 0 }, | - | 469 | { 0x061B, 0 }, | - | 470 | { 0x061C, 0 }, | - | 471 | { 0x061D, 0 }, | - | 472 | { 0x061E, 0 }, | - | 473 | { 0x061F, 0 }, | - | 474 | | - | 475 | { 0x0620, 0 }, | - | 476 | { 0xFE80, 0 }, | - | 477 | { 0xFE81, 1 }, | - | 478 | { 0xFE83, 1 }, | - | 479 | { 0xFE85, 1 }, | - | 480 | { 0xFE87, 1 }, | - | 481 | { 0xFE89, 3 }, | - | 482 | { 0xFE8D, 1 }, | - | 483 | { 0xFE8F, 3 }, | - | 484 | { 0xFE93, 1 }, | - | 485 | { 0xFE95, 3 }, | - | 486 | { 0xFE99, 3 }, | - | 487 | { 0xFE9D, 3 }, | - | 488 | { 0xFEA1, 3 }, | - | 489 | { 0xFEA5, 3 }, | - | 490 | { 0xFEA9, 1 }, | - | 491 | | - | 492 | { 0xFEAB, 1 }, | - | 493 | { 0xFEAD, 1 }, | - | 494 | { 0xFEAF, 1 }, | - | 495 | { 0xFEB1, 3 }, | - | 496 | { 0xFEB5, 3 }, | - | 497 | { 0xFEB9, 3 }, | - | 498 | { 0xFEBD, 3 }, | - | 499 | { 0xFEC1, 3 }, | - | 500 | { 0xFEC5, 3 }, | - | 501 | { 0xFEC9, 3 }, | - | 502 | { 0xFECD, 3 }, | - | 503 | { 0x063B, 0 }, | - | 504 | { 0x063C, 0 }, | - | 505 | { 0x063D, 0 }, | - | 506 | { 0x063E, 0 }, | - | 507 | { 0x063F, 0 }, | - | 508 | | - | 509 | { 0x0640, 0 }, | - | 510 | { 0xFED1, 3 }, | - | 511 | { 0xFED5, 3 }, | - | 512 | { 0xFED9, 3 }, | - | 513 | { 0xFEDD, 3 }, | - | 514 | { 0xFEE1, 3 }, | - | 515 | { 0xFEE5, 3 }, | - | 516 | { 0xFEE9, 3 }, | - | 517 | { 0xFEED, 1 }, | - | 518 | { 0x0649, 3 }, | - | 519 | { 0xFEF1, 3 }, | - | 520 | { 0x064B, 0 }, | - | 521 | { 0x064C, 0 }, | - | 522 | { 0x064D, 0 }, | - | 523 | { 0x064E, 0 }, | - | 524 | { 0x064F, 0 }, | - | 525 | | - | 526 | { 0x0650, 0 }, | - | 527 | { 0x0651, 0 }, | - | 528 | { 0x0652, 0 }, | - | 529 | { 0x0653, 0 }, | - | 530 | { 0x0654, 0 }, | - | 531 | { 0x0655, 0 }, | - | 532 | { 0x0656, 0 }, | - | 533 | { 0x0657, 0 }, | - | 534 | { 0x0658, 0 }, | - | 535 | { 0x0659, 0 }, | - | 536 | { 0x065A, 0 }, | - | 537 | { 0x065B, 0 }, | - | 538 | { 0x065C, 0 }, | - | 539 | { 0x065D, 0 }, | - | 540 | { 0x065E, 0 }, | - | 541 | { 0x065F, 0 }, | - | 542 | | - | 543 | { 0x0660, 0 }, | - | 544 | { 0x0661, 0 }, | - | 545 | { 0x0662, 0 }, | - | 546 | { 0x0663, 0 }, | - | 547 | { 0x0664, 0 }, | - | 548 | { 0x0665, 0 }, | - | 549 | { 0x0666, 0 }, | - | 550 | { 0x0667, 0 }, | - | 551 | { 0x0668, 0 }, | - | 552 | { 0x0669, 0 }, | - | 553 | { 0x066A, 0 }, | - | 554 | { 0x066B, 0 }, | - | 555 | { 0x066C, 0 }, | - | 556 | { 0x066D, 0 }, | - | 557 | { 0x066E, 0 }, | - | 558 | { 0x066F, 0 }, | - | 559 | | - | 560 | { 0x0670, 0 }, | - | 561 | { 0xFB50, 1 }, | - | 562 | { 0x0672, 0 }, | - | 563 | { 0x0673, 0 }, | - | 564 | { 0x0674, 0 }, | - | 565 | { 0x0675, 0 }, | - | 566 | { 0x0676, 0 }, | - | 567 | { 0x0677, 0 }, | - | 568 | { 0x0678, 0 }, | - | 569 | { 0xFB66, 3 }, | - | 570 | { 0xFB5E, 3 }, | - | 571 | { 0xFB52, 3 }, | - | 572 | { 0x067C, 0 }, | - | 573 | { 0x067D, 0 }, | - | 574 | { 0xFB56, 3 }, | - | 575 | { 0xFB62, 3 }, | - | 576 | | - | 577 | { 0xFB5A, 3 }, | - | 578 | { 0x0681, 0 }, | - | 579 | { 0x0682, 0 }, | - | 580 | { 0xFB76, 3 }, | - | 581 | { 0xFB72, 3 }, | - | 582 | { 0x0685, 0 }, | - | 583 | { 0xFB7A, 3 }, | - | 584 | { 0xFB7E, 3 }, | - | 585 | { 0xFB88, 1 }, | - | 586 | { 0x0689, 0 }, | - | 587 | { 0x068A, 0 }, | - | 588 | { 0x068B, 0 }, | - | 589 | { 0xFB84, 1 }, | - | 590 | { 0xFB82, 1 }, | - | 591 | { 0xFB86, 1 }, | - | 592 | { 0x068F, 0 }, | - | 593 | | - | 594 | { 0x0690, 0 }, | - | 595 | { 0xFB8C, 1 }, | - | 596 | { 0x0692, 0 }, | - | 597 | { 0x0693, 0 }, | - | 598 | { 0x0694, 0 }, | - | 599 | { 0x0695, 0 }, | - | 600 | { 0x0696, 0 }, | - | 601 | { 0x0697, 0 }, | - | 602 | { 0xFB8A, 1 }, | - | 603 | { 0x0699, 0 }, | - | 604 | { 0x069A, 0 }, | - | 605 | { 0x069B, 0 }, | - | 606 | { 0x069C, 0 }, | - | 607 | { 0x069D, 0 }, | - | 608 | { 0x069E, 0 }, | - | 609 | { 0x069F, 0 }, | - | 610 | | - | 611 | { 0x06A0, 0 }, | - | 612 | { 0x06A1, 0 }, | - | 613 | { 0x06A2, 0 }, | - | 614 | { 0x06A3, 0 }, | - | 615 | { 0xFB6A, 3 }, | - | 616 | { 0x06A5, 0 }, | - | 617 | { 0xFB6E, 3 }, | - | 618 | { 0x06A7, 0 }, | - | 619 | { 0x06A8, 0 }, | - | 620 | { 0xFB8E, 3 }, | - | 621 | { 0x06AA, 0 }, | - | 622 | { 0x06AB, 0 }, | - | 623 | { 0x06AC, 0 }, | - | 624 | { 0xFBD3, 3 }, | - | 625 | { 0x06AE, 0 }, | - | 626 | { 0xFB92, 3 }, | - | 627 | | - | 628 | { 0x06B0, 0 }, | - | 629 | { 0xFB9A, 3 }, | - | 630 | { 0x06B2, 0 }, | - | 631 | { 0xFB96, 3 }, | - | 632 | { 0x06B4, 0 }, | - | 633 | { 0x06B5, 0 }, | - | 634 | { 0x06B6, 0 }, | - | 635 | { 0x06B7, 0 }, | - | 636 | { 0x06B8, 0 }, | - | 637 | { 0x06B9, 0 }, | - | 638 | { 0xFB9E, 1 }, | - | 639 | { 0xFBA0, 3 }, | - | 640 | { 0x06BC, 0 }, | - | 641 | { 0x06BD, 0 }, | - | 642 | { 0xFBAA, 3 }, | - | 643 | { 0x06BF, 0 }, | - | 644 | | - | 645 | { 0xFBA4, 1 }, | - | 646 | { 0xFBA6, 3 }, | - | 647 | { 0x06C2, 0 }, | - | 648 | { 0x06C3, 0 }, | - | 649 | { 0x06C4, 0 }, | - | 650 | { 0xFBE0, 1 }, | - | 651 | { 0xFBD9, 1 }, | - | 652 | { 0xFBD7, 1 }, | - | 653 | { 0xFBDB, 1 }, | - | 654 | { 0xFBE2, 1 }, | - | 655 | { 0x06CA, 0 }, | - | 656 | { 0xFBDE, 1 }, | - | 657 | { 0xFBFC, 3 }, | - | 658 | { 0x06CD, 0 }, | - | 659 | { 0x06CE, 0 }, | - | 660 | { 0x06CF, 0 }, | - | 661 | | - | 662 | { 0xFBE4, 3 }, | - | 663 | { 0x06D1, 0 }, | - | 664 | { 0xFBAE, 1 }, | - | 665 | { 0xFBB0, 1 }, | - | 666 | { 0x06D4, 0 }, | - | 667 | { 0x06D5, 0 }, | - | 668 | { 0x06D6, 0 }, | - | 669 | { 0x06D7, 0 }, | - | 670 | { 0x06D8, 0 }, | - | 671 | { 0x06D9, 0 }, | - | 672 | { 0x06DA, 0 }, | - | 673 | { 0x06DB, 0 }, | - | 674 | { 0x06DC, 0 }, | - | 675 | { 0x06DD, 0 }, | - | 676 | { 0x06DE, 0 }, | - | 677 | { 0x06DF, 0 }, | - | 678 | | - | 679 | { 0x06E0, 0 }, | - | 680 | { 0x06E1, 0 }, | - | 681 | { 0x06E2, 0 }, | - | 682 | { 0x06E3, 0 }, | - | 683 | { 0x06E4, 0 }, | - | 684 | { 0x06E5, 0 }, | - | 685 | { 0x06E6, 0 }, | - | 686 | { 0x06E7, 0 }, | - | 687 | { 0x06E8, 0 }, | - | 688 | { 0x06E9, 0 }, | - | 689 | { 0x06EA, 0 }, | - | 690 | { 0x06EB, 0 }, | - | 691 | { 0x06EC, 0 }, | - | 692 | { 0x06ED, 0 }, | - | 693 | { 0x06EE, 0 }, | - | 694 | { 0x06EF, 0 }, | - | 695 | | - | 696 | { 0x06F0, 0 }, | - | 697 | { 0x06F1, 0 }, | - | 698 | { 0x06F2, 0 }, | - | 699 | { 0x06F3, 0 }, | - | 700 | { 0x06F4, 0 }, | - | 701 | { 0x06F5, 0 }, | - | 702 | { 0x06F6, 0 }, | - | 703 | { 0x06F7, 0 }, | - | 704 | { 0x06F8, 0 }, | - | 705 | { 0x06F9, 0 }, | - | 706 | { 0x06FA, 0 }, | - | 707 | { 0x06FB, 0 }, | - | 708 | { 0x06FC, 0 }, | - | 709 | { 0x06FD, 0 }, | - | 710 | { 0x06FE, 0 }, | - | 711 | { 0x06FF, 0 } | - | 712 | }; | - | 713 | | - | 714 | | - | 715 | static const hb_uint16 alefMaksura[4] = {0xFEEF, 0xFEF0, 0xFBE8, 0xFBE9}; | - | 716 | | - | 717 | | - | 718 | | - | 719 | | - | 720 | | - | 721 | | - | 722 | static const hb_uint16 arabicUnicodeLamAlefMapping[6][4] = { | - | 723 | { 0xfffd, 0xfffd, 0xfef5, 0xfef6 }, | - | 724 | { 0xfffd, 0xfffd, 0xfef7, 0xfef8 }, | - | 725 | { 0xfffd, 0xfffd, 0xfffd, 0xfffd }, | - | 726 | { 0xfffd, 0xfffd, 0xfef9, 0xfefa }, | - | 727 | { 0xfffd, 0xfffd, 0xfffd, 0xfffd }, | - | 728 | { 0xfffd, 0xfffd, 0xfefb, 0xfefc } | - | 729 | }; | - | 730 | | - | 731 | static int getShape(hb_uint8 cell, int shape) | - | 732 | { | - | 733 | | - | 734 | int ch = (cell != 0x49) never evaluated: (cell != 0x49) | 0 | 735 | ? (shape ? arabicUnicodeMapping[cell][0] + shape : 0x600+cell) | - | 736 | : alefMaksura[shape] ; | - | 737 | return ch; never executed: return ch; | 0 | 738 | } | - | 739 | | - | 740 | | - | 741 | | - | 742 | | - | 743 | | - | 744 | static HB_UChar16 prevChar(const HB_UChar16 *str, int pos) | - | 745 | { | - | 746 | | - | 747 | const HB_UChar16 *ch = str + pos - 1; | - | 748 | pos--; | - | 749 | while(pos > -1) { never evaluated: pos > -1 | 0 | 750 | if(HB_GetUnicodeCharCategory(*ch) != HB_Mark_NonSpacing) never evaluated: HB_GetUnicodeCharCategory(*ch) != HB_Mark_NonSpacing | 0 | 751 | return *ch; never executed: return *ch; | 0 | 752 | pos--; | - | 753 | ch--; | - | 754 | } | 0 | 755 | return ReplacementCharacter; never executed: return ReplacementCharacter; | 0 | 756 | } | - | 757 | | - | 758 | static HB_UChar16 nextChar(const HB_UChar16 *str, hb_uint32 len, hb_uint32 pos) | - | 759 | { | - | 760 | const HB_UChar16 *ch = str + pos + 1; | - | 761 | pos++; | - | 762 | while(pos < len) { never evaluated: pos < len | 0 | 763 | | - | 764 | if(HB_GetUnicodeCharCategory(*ch) != HB_Mark_NonSpacing) never evaluated: HB_GetUnicodeCharCategory(*ch) != HB_Mark_NonSpacing | 0 | 765 | return *ch; never executed: return *ch; | 0 | 766 | | - | 767 | pos++; | - | 768 | ch++; | - | 769 | } | 0 | 770 | return ReplacementCharacter; never executed: return ReplacementCharacter; | 0 | 771 | } | - | 772 | | - | 773 | static void shapedString(const HB_UChar16 *uc, hb_uint32 stringLength, hb_uint32 from, hb_uint32 len, HB_UChar16 *shapeBuffer, int *shapedLength, | - | 774 | HB_Bool reverse, HB_GlyphAttributes *attributes, unsigned short *logClusters) | - | 775 | { | - | 776 | HB_ArabicProperties *properties; | - | 777 | hb_int32 f = from; | - | 778 | hb_uint32 l = len; | - | 779 | const HB_UChar16 *ch; | - | 780 | HB_UChar16 *data; | - | 781 | int clusterStart; | - | 782 | hb_uint32 i; | - | 783 | HB_ArabicProperties stackprops[512]; HB_ArabicProperties *props = stackprops; if ((len + 2) >= 512) props = (HB_ArabicProperties *)malloc((len + 2) * sizeof(HB_ArabicProperties));; never evaluated: (len + 2) >= 512 never executed: props = (HB_ArabicProperties *)malloc((len + 2) * sizeof(HB_ArabicProperties)); | 0 | 784 | properties = props; | - | 785 | | - | 786 | ((stringLength >= from + len) ? static_cast<void> (0) : __assert_fail ("stringLength >= from + len", "../3rdparty/harfbuzz/src/harfbuzz-arabic.c", 902, __PRETTY_FUNCTION__)); | - | 787 | | - | 788 | if(len == 0) { never evaluated: len == 0 | 0 | 789 | *shapedLength = 0; | - | 790 | return; | 0 | 791 | } | - | 792 | | - | 793 | if (from > 0) { never evaluated: from > 0 | 0 | 794 | --f; | - | 795 | ++l; | - | 796 | ++properties; | - | 797 | } | 0 | 798 | if (f + l < stringLength) never evaluated: f + l < stringLength | 0 | 799 | ++l; | 0 | 800 | getArabicProperties(uc+f, l, props); | - | 801 | | - | 802 | ch = uc + from; | - | 803 | data = shapeBuffer; | - | 804 | clusterStart = 0; | - | 805 | | - | 806 | for (i = 0; i < len; i++) { | 0 | 807 | hb_uint8 r = *ch >> 8; | - | 808 | int gpos = data - shapeBuffer; | - | 809 | | - | 810 | if (r != 0x06) { never evaluated: r != 0x06 | 0 | 811 | if (r == 0x20) { never evaluated: r == 0x20 | 0 | 812 | if (*ch == 0x200c || *ch == 0x200d) never evaluated: *ch == 0x200c never evaluated: *ch == 0x200d | 0 | 813 | | - | 814 | goto skip; never executed: goto skip; | 0 | 815 | } | 0 | 816 | if (reverse) | 0 | 817 | *data = HB_GetMirroredChar(*ch); never executed: *data = HB_GetMirroredChar(*ch); | 0 | 818 | else | - | 819 | *data = *ch; never executed: *data = *ch; | 0 | 820 | } else { | - | 821 | hb_uint8 c = *ch & 0xff; | - | 822 | int pos = i + from; | - | 823 | int shape = properties[i].shape; | - | 824 | | - | 825 | | - | 826 | hb_uint16 map; | - | 827 | switch (c) { | - | 828 | case 0x44: { | - | 829 | const HB_UChar16 pch = nextChar(uc, stringLength, pos); | - | 830 | if ((pch >> 8) == 0x06) { never evaluated: (pch >> 8) == 0x06 | 0 | 831 | switch (pch & 0xff) { | - | 832 | case 0x22: | - | 833 | case 0x23: | - | 834 | case 0x25: | - | 835 | case 0x27: | - | 836 | | - | 837 | map = arabicUnicodeLamAlefMapping[(pch & 0xff) - 0x22][shape]; | - | 838 | goto next; never executed: goto next; | 0 | 839 | default: | - | 840 | break; | 0 | 841 | } | - | 842 | } | 0 | 843 | break; | 0 | 844 | } | - | 845 | case 0x22: | - | 846 | case 0x23: | - | 847 | case 0x25: | - | 848 | case 0x27: | - | 849 | if (prevChar(uc, pos) == 0x0644) { never evaluated: prevChar(uc, pos) == 0x0644 | 0 | 850 | | - | 851 | | - | 852 | goto skip; never executed: goto skip; | 0 | 853 | } | - | 854 | default: | - | 855 | break; | 0 | 856 | } | - | 857 | map = getShape(c, shape); | - | 858 | next: code before this statement never executed: next: | 0 | 859 | *data = map; | - | 860 | } | 0 | 861 | | - | 862 | | - | 863 | if (HB_GetUnicodeCharCategory(*ch) == HB_Mark_NonSpacing) { never evaluated: HB_GetUnicodeCharCategory(*ch) == HB_Mark_NonSpacing | 0 | 864 | attributes[gpos].mark = (!0); | - | 865 | | - | 866 | } else { | 0 | 867 | attributes[gpos].mark = 0; | - | 868 | clusterStart = data - shapeBuffer; | - | 869 | } | 0 | 870 | attributes[gpos].clusterStart = !attributes[gpos].mark; | - | 871 | attributes[gpos].combiningClass = HB_GetUnicodeCharCombiningClass(*ch); | - | 872 | attributes[gpos].justification = properties[i].justification; | - | 873 | | - | 874 | data++; | - | 875 | skip: code before this statement never executed: skip: | 0 | 876 | ch++; | - | 877 | logClusters[i] = clusterStart; | - | 878 | } | 0 | 879 | *shapedLength = data - shapeBuffer; | - | 880 | | - | 881 | if (stackprops != props) free(props);; never evaluated: stackprops != props never executed: free(props); | 0 | 882 | } | 0 | 883 | | - | 884 | | - | 885 | | - | 886 | static const HB_OpenTypeFeature arabic_features[] = { | - | 887 | { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'c' << 16 ) | ( (HB_UInt)'m' << 8 ) | (HB_UInt)'p' ), CcmpProperty }, | - | 888 | { ( ( (HB_UInt)'i' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'o' << 8 ) | (HB_UInt)'l' ), IsolProperty }, | - | 889 | { ( ( (HB_UInt)'f' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'n' << 8 ) | (HB_UInt)'a' ), FinaProperty }, | - | 890 | { ( ( (HB_UInt)'m' << 24 ) | ( (HB_UInt)'e' << 16 ) | ( (HB_UInt)'d' << 8 ) | (HB_UInt)'i' ), MediProperty }, | - | 891 | { ( ( (HB_UInt)'i' << 24 ) | ( (HB_UInt)'n' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'t' ), InitProperty }, | - | 892 | { ( ( (HB_UInt)'r' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'g' ), RligProperty }, | - | 893 | { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'l' << 8 ) | (HB_UInt)'t' ), CaltProperty }, | - | 894 | { ( ( (HB_UInt)'l' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'g' << 8 ) | (HB_UInt)'a' ), LigaProperty }, | - | 895 | { ( ( (HB_UInt)'d' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'g' ), DligProperty }, | - | 896 | { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'w' << 8 ) | (HB_UInt)'h' ), CswhProperty }, | - | 897 | | - | 898 | { ( ( (HB_UInt)'m' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'e' << 8 ) | (HB_UInt)'t' ), MsetProperty }, | - | 899 | {0, 0} | - | 900 | }; | - | 901 | | - | 902 | static const HB_OpenTypeFeature syriac_features[] = { | - | 903 | { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'c' << 16 ) | ( (HB_UInt)'m' << 8 ) | (HB_UInt)'p' ), CcmpProperty }, | - | 904 | { ( ( (HB_UInt)'i' << 24 ) | ( (HB_UInt)'s' << 16 ) | ( (HB_UInt)'o' << 8 ) | (HB_UInt)'l' ), IsolProperty }, | - | 905 | { ( ( (HB_UInt)'f' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'n' << 8 ) | (HB_UInt)'a' ), FinaProperty }, | - | 906 | { ( ( (HB_UInt)'f' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'n' << 8 ) | (HB_UInt)'2' ), FinaProperty }, | - | 907 | { ( ( (HB_UInt)'f' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'n' << 8 ) | (HB_UInt)'3' ), FinaProperty }, | - | 908 | { ( ( (HB_UInt)'m' << 24 ) | ( (HB_UInt)'e' << 16 ) | ( (HB_UInt)'d' << 8 ) | (HB_UInt)'i' ), MediProperty }, | - | 909 | { ( ( (HB_UInt)'m' << 24 ) | ( (HB_UInt)'e' << 16 ) | ( (HB_UInt)'d' << 8 ) | (HB_UInt)'2' ), MediProperty }, | - | 910 | { ( ( (HB_UInt)'i' << 24 ) | ( (HB_UInt)'n' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'t' ), InitProperty }, | - | 911 | { ( ( (HB_UInt)'r' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'g' ), RligProperty }, | - | 912 | { ( ( (HB_UInt)'c' << 24 ) | ( (HB_UInt)'a' << 16 ) | ( (HB_UInt)'l' << 8 ) | (HB_UInt)'t' ), CaltProperty }, | - | 913 | { ( ( (HB_UInt)'l' << 24 ) | ( (HB_UInt)'i' << 16 ) | ( (HB_UInt)'g' << 8 ) | (HB_UInt)'a' ), LigaProperty }, | - | 914 | { ( ( (HB_UInt)'d' << 24 ) | ( (HB_UInt)'l' << 16 ) | ( (HB_UInt)'i' << 8 ) | (HB_UInt)'g' ), DligProperty }, | - | 915 | {0, 0} | - | 916 | }; | - | 917 | | - | 918 | static HB_Bool arabicSyriacOpenTypeShape(HB_ShaperItem *item, HB_Bool *ot_ok) | - | 919 | { | - | 920 | const HB_UChar16 *uc; | - | 921 | const int nglyphs = item->num_glyphs; | - | 922 | hb_int32 f; | - | 923 | hb_uint32 l; | - | 924 | HB_ArabicProperties *properties; | - | 925 | HB_ArabicProperties stackprops[512]; HB_ArabicProperties *props = stackprops; | - | 926 | hb_uint32 stackapply[512]; hb_uint32 *apply = stackapply; | - | 927 | HB_Bool shaped; | - | 928 | int i = 0; | - | 929 | | - | 930 | *ot_ok = (!0); | - | 931 | | - | 932 | if (!HB_ConvertStringToGlyphIndices(item)) partially evaluated: !HB_ConvertStringToGlyphIndices(item) no Evaluation Count:0 | yes Evaluation Count:57 |
| 0-57 | 933 | return 0; never executed: return 0; | 0 | 934 | HB_HeuristicSetGlyphAttributes(item); | - | 935 | | - | 936 | if ((item->item.length + 2) >= 512) props = (HB_ArabicProperties *)malloc((item->item.length + 2) * sizeof(HB_ArabicProperties));; partially evaluated: (item->item.length + 2) >= 512 no Evaluation Count:0 | yes Evaluation Count:57 |
never executed: props = (HB_ArabicProperties *)malloc((item->item.length + 2) * sizeof(HB_ArabicProperties)); | 0-57 | 937 | if ((item->num_glyphs) >= 512) apply = (hb_uint32 *)malloc((item->num_glyphs) * sizeof(hb_uint32));; partially evaluated: (item->num_glyphs) >= 512 no Evaluation Count:0 | yes Evaluation Count:57 |
never executed: apply = (hb_uint32 *)malloc((item->num_glyphs) * sizeof(hb_uint32)); | 0-57 | 938 | | - | 939 | uc = item->string + item->item.pos; | - | 940 | | - | 941 | properties = props; | - | 942 | f = 0; | - | 943 | l = item->item.length; | - | 944 | if (item->item.pos > 0) { evaluated: item->item.pos > 0 yes Evaluation Count:33 | yes Evaluation Count:24 |
| 24-33 | 945 | --f; | - | 946 | ++l; | - | 947 | ++properties; | - | 948 | } executed: } Execution Count:33 | 33 | 949 | if (f + l + item->item.pos < item->stringLength) { evaluated: f + l + item->item.pos < item->stringLength yes Evaluation Count:37 | yes Evaluation Count:20 |
| 20-37 | 950 | ++l; | - | 951 | } executed: } Execution Count:37 | 37 | 952 | if (item->item.script == HB_Script_Nko) partially evaluated: item->item.script == HB_Script_Nko no Evaluation Count:0 | yes Evaluation Count:57 |
| 0-57 | 953 | getNkoProperties(uc+f, l, props); never executed: getNkoProperties(uc+f, l, props); | 0 | 954 | else | - | 955 | getArabicProperties(uc+f, l, props); executed: getArabicProperties(uc+f, l, props); Execution Count:57 | 57 | 956 | | - | 957 | for (i = 0; i < (int)item->num_glyphs; i++) { evaluated: i < (int)item->num_glyphs yes Evaluation Count:191 | yes Evaluation Count:57 |
| 57-191 | 958 | apply[i] = 0; | - | 959 | | - | 960 | if (properties[i].shape == XIsolated) evaluated: properties[i].shape == XIsolated yes Evaluation Count:61 | yes Evaluation Count:130 |
| 61-130 | 961 | apply[i] |= MediProperty|FinaProperty|InitProperty; executed: apply[i] |= MediProperty|FinaProperty|InitProperty; Execution Count:61 | 61 | 962 | else if (properties[i].shape == XMedial) evaluated: properties[i].shape == XMedial yes Evaluation Count:18 | yes Evaluation Count:112 |
| 18-112 | 963 | apply[i] |= IsolProperty|FinaProperty|InitProperty; executed: apply[i] |= IsolProperty|FinaProperty|InitProperty; Execution Count:18 | 18 | 964 | else if (properties[i].shape == XFinal) evaluated: properties[i].shape == XFinal yes Evaluation Count:56 | yes Evaluation Count:56 |
| 56 | 965 | apply[i] |= IsolProperty|MediProperty|InitProperty; executed: apply[i] |= IsolProperty|MediProperty|InitProperty; Execution Count:56 | 56 | 966 | else if (properties[i].shape == XInitial) partially evaluated: properties[i].shape == XInitial yes Evaluation Count:56 | no Evaluation Count:0 |
| 0-56 | 967 | apply[i] |= IsolProperty|MediProperty|FinaProperty; executed: apply[i] |= IsolProperty|MediProperty|FinaProperty; Execution Count:56 | 56 | 968 | | - | 969 | item->attributes[i].justification = properties[i].justification; | - | 970 | } executed: } Execution Count:191 | 191 | 971 | | - | 972 | if (stackprops != props) free(props);; partially evaluated: stackprops != props no Evaluation Count:0 | yes Evaluation Count:57 |
never executed: free(props); | 0-57 | 973 | | - | 974 | shaped = HB_OpenTypeShape(item, apply); | - | 975 | | - | 976 | if (stackapply != apply) free(apply);; partially evaluated: stackapply != apply no Evaluation Count:0 | yes Evaluation Count:57 |
never executed: free(apply); | 0-57 | 977 | | - | 978 | if (!shaped) { partially evaluated: !shaped no Evaluation Count:0 | yes Evaluation Count:57 |
| 0-57 | 979 | *ot_ok = 0; | - | 980 | return 0; never executed: return 0; | 0 | 981 | } | - | 982 | return HB_OpenTypePosition(item, nglyphs, (!0)); executed: return HB_OpenTypePosition(item, nglyphs, (!0)); Execution Count:57 | 57 | 983 | } | - | 984 | | - | 985 | | - | 986 | | - | 987 | | - | 988 | HB_Bool HB_ArabicShape(HB_ShaperItem *item) | - | 989 | { | - | 990 | int slen; | - | 991 | HB_Bool haveGlyphs; | - | 992 | HB_UChar16 stackshapedChars[512]; HB_UChar16 *shapedChars = stackshapedChars; if ((item->item.length) >= 512) shapedChars = (HB_UChar16 *)malloc((item->item.length) * sizeof(HB_UChar16));; partially evaluated: (item->item.length) >= 512 no Evaluation Count:0 | yes Evaluation Count:57 |
never executed: shapedChars = (HB_UChar16 *)malloc((item->item.length) * sizeof(HB_UChar16)); | 0-57 | 993 | | - | 994 | ((item->item.script == HB_Script_Arabic || item->item.script == HB_Script_Syriac || item->item.script == HB_Script_Nko) ? static_cast<void> (0) : __assert_fail ("item->item.script == HB_Script_Arabic || item->item.script == HB_Script_Syriac || item->item.script == HB_Script_Nko", "../3rdparty/harfbuzz/src/harfbuzz-arabic.c", 1111, __PRETTY_FUNCTION__)); | - | 995 | | - | 996 | | - | 997 | | - | 998 | | - | 999 | if (HB_SelectScript(item, item->item.script == HB_Script_Arabic ? arabic_features : syriac_features)) { partially evaluated: HB_SelectScript(item, item->item.script == HB_Script_Arabic ? arabic_features : syriac_features) yes Evaluation Count:57 | no Evaluation Count:0 |
| 0-57 | 1000 | HB_Bool ot_ok; | - | 1001 | if (arabicSyriacOpenTypeShape(item, &ot_ok)) partially evaluated: arabicSyriacOpenTypeShape(item, &ot_ok) yes Evaluation Count:57 | no Evaluation Count:0 |
| 0-57 | 1002 | return (!0); executed: return (!0); Execution Count:57 | 57 | 1003 | if (ot_ok) | 0 | 1004 | return 0; never executed: return 0; | 0 | 1005 | | - | 1006 | } | 0 | 1007 | | - | 1008 | | - | 1009 | if (item->item.script != HB_Script_Arabic) never evaluated: item->item.script != HB_Script_Arabic | 0 | 1010 | return HB_BasicShape(item); never executed: return HB_BasicShape(item); | 0 | 1011 | | - | 1012 | shapedString(item->string, item->stringLength, item->item.pos, item->item.length, shapedChars, &slen, | - | 1013 | item->item.bidiLevel % 2, | - | 1014 | item->attributes, item->log_clusters); | - | 1015 | | - | 1016 | haveGlyphs = item->font->klass | - | 1017 | ->convertStringToGlyphIndices(item->font, | - | 1018 | shapedChars, slen, | - | 1019 | item->glyphs, &item->num_glyphs, | - | 1020 | item->item.bidiLevel % 2); | - | 1021 | | - | 1022 | if (stackshapedChars != shapedChars) free(shapedChars);; never evaluated: stackshapedChars != shapedChars never executed: free(shapedChars); | 0 | 1023 | | - | 1024 | if (!haveGlyphs) never evaluated: !haveGlyphs | 0 | 1025 | return 0; never executed: return 0; | 0 | 1026 | | - | 1027 | HB_HeuristicPosition(item); | - | 1028 | return (!0); never executed: return (!0); | 0 | 1029 | } | - | 1030 | | - | | | |
|