Implement 'Phags-pa shaping

Through the Arabic shaper.  It's similar to Mongolian.
This commit is contained in:
Behdad Esfahbod 2012-11-01 20:05:04 -07:00
parent 431bef2e16
commit 3ba7bc14ea
2 changed files with 13 additions and 6 deletions

View File

@ -64,15 +64,24 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
return j_type;
}
/* Mongolian joining data is not in ArabicJoining.txt yet */
/* Mongolian joining data is not in ArabicJoining.txt yet. */
if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1800, 0x18AF)))
{
/* All letters, SIBE SYLLABLE BOUNDARY MARKER, and NIRUGU are D */
if (gen_cat == HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER || u == 0x1807 || u == 0x180A)
if ((FLAG(gen_cat) & (FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) |
FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER)))
|| u == 0x1807 || u == 0x180A)
return JOINING_TYPE_D;
}
if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x200C, 0x200D))) {
/* 'Phags-pa joining data is not in ArabicJoining.txt yet. */
if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xA840, 0xA872)))
{
return JOINING_TYPE_D;
}
if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x200C, 0x200D)))
{
return u == 0x200C ? JOINING_TYPE_U : JOINING_TYPE_C;
}

View File

@ -130,6 +130,7 @@ hb_ot_shape_complex_categorize (const hb_segment_properties_t *props)
/* Unicode-5.0 additions */
case HB_SCRIPT_NKO:
case HB_SCRIPT_PHAGS_PA:
/* Unicode-6.0 additions */
case HB_SCRIPT_MANDAIC:
@ -199,9 +200,6 @@ hb_ot_shape_complex_categorize (const hb_segment_properties_t *props)
/* Unicode-4.1 additions */
case HB_SCRIPT_SYLOTI_NAGRI:
/* Unicode-5.0 additions */
case HB_SCRIPT_PHAGS_PA:
/* Unicode-5.1 additions */
case HB_SCRIPT_KAYAH_LI: