summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-05-11 17:54:26 +0200
committerBehdad Esfahbod <behdad@behdad.org>2012-05-11 17:54:26 +0200
commit3399a06e7033651ee926448737bdb18e553c1796 (patch)
tree63f6739a3ab6439162a5a0e7245a43ac689a88d6 /src
parent11aa3ef18dbc6ac9561bd119f5ca2c1aa1209c3a (diff)
[Indic] Fix U+0952 and similar classification to match Uniscribe
See comments.
Diffstat (limited to 'src')
-rw-r--r--src/hb-ot-shape-complex-indic-machine.rl1
-rw-r--r--src/hb-ot-shape-complex-indic.cc16
2 files changed, 12 insertions, 5 deletions
diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index bf77b023..b26e2a72 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -77,6 +77,7 @@ main := |*
#define process_syllable(func) \
HB_STMT_START { \
+ /* printf ("syllable %d..%d %s\n", last, p+1, #func); */ \
for (unsigned int i = last; i < p+1; i++) \
info[i].syllable() = syllable_serial; \
PASTE (initial_reordering_, func) (map, buffer, mask_array, last, p+1); \
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index ec607384..a3a75e46 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -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_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) {
info.indic_position() = consonant_position (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))
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;
- }
}
}