[Indic] Fix U+0952 and similar classification to match Uniscribe

See comments.
This commit is contained in:
Behdad Esfahbod 2012-05-11 17:54:26 +02:00
parent 11aa3ef18d
commit 3399a06e70
2 changed files with 12 additions and 5 deletions

View File

@ -77,6 +77,7 @@ main := |*
#define process_syllable(func) \ #define process_syllable(func) \
HB_STMT_START { \ HB_STMT_START { \
/* printf ("syllable %d..%d %s\n", last, p+1, #func); */ \
for (unsigned int i = last; i < p+1; i++) \ for (unsigned int i = last; i < p+1; i++) \
info[i].syllable() = syllable_serial; \ info[i].syllable() = syllable_serial; \
PASTE (initial_reordering_, func) (map, buffer, mask_array, last, p+1); \ PASTE (initial_reordering_, func) (map, buffer, mask_array, last, p+1); \

View File

@ -191,6 +191,17 @@ _hb_ot_shape_complex_setup_masks_indic (hb_ot_map_t *map, hb_buffer_t *buffer, h
info.indic_category() = type & 0x0F; info.indic_category() = type & 0x0F;
info.indic_position() = type >> 4; info.indic_position() = type >> 4;
/* The spec says U+0952 is OT_A. However, testing shows that Uniscribe
* treats U+0951..U+0952 all as OT_VD.
* TESTS:
* U+092E,U+0947,U+0952
* U+092E,U+0952,U+0947
* U+092E,U+0947,U+0951
* U+092E,U+0951,U+0947
* */
if (unlikely (hb_in_range<hb_codepoint_t> (info.codepoint, 0x0951, 0x0954)))
info.indic_category() = OT_VD;
if (info.indic_category() == OT_C) { if (info.indic_category() == OT_C) {
info.indic_position() = consonant_position (info.codepoint); info.indic_position() = consonant_position (info.codepoint);
if (is_ra (info.codepoint)) if (is_ra (info.codepoint))
@ -203,11 +214,6 @@ _hb_ot_shape_complex_setup_masks_indic (hb_ot_map_t *map, hb_buffer_t *buffer, h
else if (unlikely (info.codepoint == 0x200D)) else if (unlikely (info.codepoint == 0x200D))
info.indic_category() = OT_ZWJ; info.indic_category() = OT_ZWJ;
/* The spec only suggests this for U+0952, but we do more. */
if (unlikely (hb_in_range<hb_codepoint_t> (info.codepoint, 0x0951, 0x0954))) {
info.indic_category() = OT_A;
info.indic_position() = POS_SMVD;
}
} }
} }