From 3b58ce45182eb6e9ff504dfb5f1a5720379030e2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 13 Oct 2025 13:26:23 -0600 Subject: [PATCH 1/2] [shape] Disable `kern` table in most shapers Only default, Arabic, and Hebrew keep it. Fixes https://github.com/harfbuzz/harfbuzz/issues/5607 Needs documentation update. --- src/hb-ot-shape.cc | 6 +++--- src/hb-ot-shape.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index f43ff9f92..a1ce1eef5 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -93,7 +93,7 @@ hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *fac shaper = hb_ot_shaper_categorize (props.script, props.direction, map.chosen_script[0]); script_zero_marks = shaper->zero_width_marks != HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE; - script_fallback_mark_positioning = shaper->fallback_position; + script_fallback_position = shaper->fallback_position; #ifndef HB_NO_AAT_SHAPE /* https://github.com/harfbuzz/harfbuzz/issues/1528 */ @@ -179,7 +179,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, #endif #ifndef HB_NO_OT_KERN else if (hb_ot_layout_has_kerning (face)) - plan.apply_kern = true; + plan.apply_kern = script_fallback_position; // Not all shapers apply legacy `kern` #endif else {} } @@ -204,7 +204,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, ); plan.fallback_mark_positioning = plan.adjust_mark_positioning_when_zeroing && - script_fallback_mark_positioning; + script_fallback_position; #ifndef HB_NO_AAT_SHAPE /* If we're using morx shaping, we cancel mark position adjustment because diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh index af71fb45b..c30b2cfd4 100644 --- a/src/hb-ot-shape.hh +++ b/src/hb-ot-shape.hh @@ -150,7 +150,7 @@ struct hb_ot_shape_planner_t static constexpr bool apply_morx = false; #endif bool script_zero_marks : 1; - bool script_fallback_mark_positioning : 1; + bool script_fallback_position : 1; const struct hb_ot_shaper_t *shaper; HB_INTERNAL hb_ot_shape_planner_t (hb_face_t *face, From 63e8c13e1665b40b13f3ccba91711603f45a1266 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 15 Oct 2025 12:41:50 -0600 Subject: [PATCH 2/2] [hangul] Enable fallback position / kern table https://github.com/harfbuzz/harfbuzz/pull/5609#issuecomment-3400878406 --- src/hb-ot-shaper-hangul.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-shaper-hangul.cc b/src/hb-ot-shaper-hangul.cc index 50ea53272..792b658bf 100644 --- a/src/hb-ot-shaper-hangul.cc +++ b/src/hb-ot-shaper-hangul.cc @@ -427,7 +427,7 @@ const hb_ot_shaper_t _hb_ot_shaper_hangul = HB_TAG_NONE, /* gpos_tag */ HB_OT_SHAPE_NORMALIZATION_MODE_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, - false, /* fallback_position */ + true, /* fallback_position */ };