| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2010,2012 Google, Inc. | 2 * Copyright © 2010,2012 Google, Inc. |
| 3 * | 3 * |
| 4 * This is part of HarfBuzz, a text shaping library. | 4 * This is part of HarfBuzz, a text shaping library. |
| 5 * | 5 * |
| 6 * Permission is hereby granted, without written agreement and without | 6 * Permission is hereby granted, without written agreement and without |
| 7 * license or royalty fees, to use, copy, modify, and distribute this | 7 * license or royalty fees, to use, copy, modify, and distribute this |
| 8 * software and its documentation for any purpose, provided that the | 8 * software and its documentation for any purpose, provided that the |
| 9 * above copyright notice and the following two paragraphs appear in | 9 * above copyright notice and the following two paragraphs appear in |
| 10 * all copies of this software. | 10 * all copies of this software. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 /* | 52 /* |
| 53 * Joining types: | 53 * Joining types: |
| 54 */ | 54 */ |
| 55 | 55 |
| 56 #include "hb-ot-shape-complex-arabic-table.hh" | 56 #include "hb-ot-shape-complex-arabic-table.hh" |
| 57 | 57 |
| 58 static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
ory_t gen_cat) | 58 static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
ory_t gen_cat) |
| 59 { | 59 { |
| 60 if (likely (hb_in_range<hb_codepoint_t> (u, JOINING_TABLE_FIRST, JOINING_TABLE
_LAST))) { | 60 unsigned int j_type = joining_type(u); |
| 61 unsigned int j_type = joining_table[u - JOINING_TABLE_FIRST]; | 61 if (likely (j_type != JOINING_TYPE_X)) |
| 62 if (likely (j_type != JOINING_TYPE_X)) | 62 return j_type; |
| 63 return j_type; | |
| 64 } | |
| 65 | 63 |
| 66 /* Mongolian joining data is not in ArabicJoining.txt yet. */ | 64 return (FLAG(gen_cat) & |
| 67 if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1800, 0x18AF))) | 65 » (FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | |
| 68 { | 66 » FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | |
| 69 if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1880, 0x1886))) | 67 » FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT)) |
| 70 return JOINING_TYPE_U; | 68 » ) ? JOINING_TYPE_T : JOINING_TYPE_U; |
| 71 | |
| 72 /* All letters, SIBE SYLLABLE BOUNDARY MARKER, and NIRUGU are D */ | |
| 73 if ((FLAG(gen_cat) & (FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) | | |
| 74 » » » FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER))) | |
| 75 » || u == 0x1807 || u == 0x180A) | |
| 76 return JOINING_TYPE_D; | |
| 77 } | |
| 78 | |
| 79 /* 'Phags-pa joining data is not in ArabicJoining.txt yet. */ | |
| 80 if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xA840, 0xA872))) | |
| 81 { | |
| 82 if (unlikely (u == 0xA872)) | |
| 83 » return JOINING_TYPE_L; | |
| 84 | |
| 85 return JOINING_TYPE_D; | |
| 86 } | |
| 87 | |
| 88 if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x200C, 0x200D))) | |
| 89 { | |
| 90 return u == 0x200C ? JOINING_TYPE_U : JOINING_TYPE_C; | |
| 91 } | |
| 92 | |
| 93 return (FLAG(gen_cat) & (FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) |
FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | FLAG(HB_UNICODE_GENERAL_CATEG
ORY_FORMAT))) ? | |
| 94 » JOINING_TYPE_T : JOINING_TYPE_U; | |
| 95 } | 69 } |
| 96 | 70 |
| 97 static const hb_tag_t arabic_features[] = | 71 static const hb_tag_t arabic_features[] = |
| 98 { | 72 { |
| 99 HB_TAG('i','n','i','t'), | 73 HB_TAG('i','n','i','t'), |
| 100 HB_TAG('m','e','d','i'), | 74 HB_TAG('m','e','d','i'), |
| 101 HB_TAG('f','i','n','a'), | 75 HB_TAG('f','i','n','a'), |
| 102 HB_TAG('i','s','o','l'), | 76 HB_TAG('i','s','o','l'), |
| 103 /* Syriac */ | 77 /* Syriac */ |
| 104 HB_TAG('m','e','d','2'), | 78 HB_TAG('m','e','d','2'), |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 data_create_arabic, | 339 data_create_arabic, |
| 366 data_destroy_arabic, | 340 data_destroy_arabic, |
| 367 NULL, /* preprocess_text_arabic */ | 341 NULL, /* preprocess_text_arabic */ |
| 368 HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, | 342 HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, |
| 369 NULL, /* decompose */ | 343 NULL, /* decompose */ |
| 370 NULL, /* compose */ | 344 NULL, /* compose */ |
| 371 setup_masks_arabic, | 345 setup_masks_arabic, |
| 372 HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, | 346 HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE, |
| 373 true, /* fallback_position */ | 347 true, /* fallback_position */ |
| 374 }; | 348 }; |
| OLD | NEW |