diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 75f5fe9c66908061b96e8a4fae37f63856d2fe42..1f63c125e6463951b6d4e0bb92bd20ff58c2f90e 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -206,7 +206,7 @@ _hb_ot_shape_complex_override_features_arabic (hb_ot_map_builder_t *map, } hb_ot_shape_normalization_mode_t -_hb_ot_shape_complex_normalization_preference_arabic (void) +_hb_ot_shape_complex_normalization_preference_arabic (const hb_segment_properties_t *props) { return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS; } diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index e4c151aac94d42bdedda7442939cc66120872373..c7025ffed6245fe079589dfb0685243a61fbe37e 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -420,10 +420,8 @@ _hb_ot_shape_complex_override_features_indic (hb_ot_map_builder_t *map, hb_ot_shape_normalization_mode_t -_hb_ot_shape_complex_normalization_preference_indic (void) +_hb_ot_shape_complex_normalization_preference_indic (const hb_segment_properties_t *props) { - /* We want split matras decomposed by the common shaping logic. */ - /* XXX sort this out after adding per-shaper normalizers. */ return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS; } diff --git a/src/hb-ot-shape-complex-misc.cc b/src/hb-ot-shape-complex-misc.cc index 4578f0bf709d6f4535fa4d0008608992f9b154d2..4b9e6a67698dd6ed606bda18924bf0a1c21963a8 100644 --- a/src/hb-ot-shape-complex-misc.cc +++ b/src/hb-ot-shape-complex-misc.cc @@ -79,8 +79,14 @@ _hb_ot_shape_complex_override_features_default (hb_ot_map_builder_t *map HB_UNUS } hb_ot_shape_normalization_mode_t -_hb_ot_shape_complex_normalization_preference_default (void) +_hb_ot_shape_complex_normalization_preference_default (const hb_segment_properties_t *props) { + switch ((hb_tag_t) props->script) + { + /* Unicode-1.1 additions */ + case HB_SCRIPT_HANGUL: + return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_FULL; + } return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS; } @@ -108,9 +114,9 @@ _hb_ot_shape_complex_override_features_thai (hb_ot_map_builder_t *map HB_UNUSED, } hb_ot_shape_normalization_mode_t -_hb_ot_shape_complex_normalization_preference_thai (void) +_hb_ot_shape_complex_normalization_preference_thai (const hb_segment_properties_t *props HB_UNUSED) { - return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_FULL; + return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS; } void diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh index d444cd6b6c655fb051f3d22b8d76f3822faec45c..689ca61759bca95b313f5e53d802322c50d4d87b 100644 --- a/src/hb-ot-shape-complex-private.hh +++ b/src/hb-ot-shape-complex-private.hh @@ -270,23 +270,22 @@ hb_ot_shape_complex_override_features (hb_ot_complex_shaper_t shaper, * normalization_preference() * * Called during shape_execute(). - * - * Shapers should return true if it prefers decomposed (NFD) input rather than precomposed (NFC). */ -typedef hb_ot_shape_normalization_mode_t hb_ot_shape_complex_normalization_preference_func_t (void); +typedef hb_ot_shape_normalization_mode_t hb_ot_shape_complex_normalization_preference_func_t (const hb_segment_properties_t *props HB_UNUSED); #define HB_COMPLEX_SHAPER_IMPLEMENT(name) \ HB_INTERNAL hb_ot_shape_complex_normalization_preference_func_t _hb_ot_shape_complex_normalization_preference_##name; HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS #undef HB_COMPLEX_SHAPER_IMPLEMENT static inline hb_ot_shape_normalization_mode_t -hb_ot_shape_complex_normalization_preference (hb_ot_complex_shaper_t shaper) +hb_ot_shape_complex_normalization_preference (hb_ot_complex_shaper_t shaper, + const hb_segment_properties_t *props) { switch (shaper) { default: #define HB_COMPLEX_SHAPER_IMPLEMENT(name) \ - case hb_ot_complex_shaper_##name: return _hb_ot_shape_complex_normalization_preference_##name (); + case hb_ot_complex_shaper_##name: return _hb_ot_shape_complex_normalization_preference_##name (props); HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS #undef HB_COMPLEX_SHAPER_IMPLEMENT } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 7831f9088ef09931fc35310e4b284f5f9ef7e6a5..c727fa6e5b165b5ce498442654e7c0c4ee7e5ca2 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -492,7 +492,9 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c) hb_ensure_native_direction (c->buffer); - _hb_ot_shape_normalize (c->font, c->buffer, hb_ot_shape_complex_normalization_preference (c->plan->shaper)); + _hb_ot_shape_normalize (c->font, c->buffer, + hb_ot_shape_complex_normalization_preference (c->plan->shaper, + &c->buffer->props)); hb_ot_shape_setup_masks (c);