From 1150d4bf12b963d8df32d9ec1cefa65b7bcb9750 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 9 Feb 2025 04:16:57 +0000 Subject: [PATCH] [trak] Remove support for disabling using pseudo-font-feature Fixes https://github.com/harfbuzz/harfbuzz/issues/5052 --- src/hb-aat-layout-trak-table.hh | 4 ---- src/hb-ot-shape.cc | 6 +----- src/hb-ot-shape.hh | 10 ---------- test/shape/data/in-house/tests/aat-trak.tests | 2 -- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index ee80c5150..a7b49a808 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -194,8 +194,6 @@ struct trak { TRACE_APPLY (this); - hb_mask_t trak_mask = c->plan->trak_mask; - float ptem = c->font->ptem; if (unlikely (ptem <= 0.f)) { @@ -212,7 +210,6 @@ struct trak hb_position_t advance_to_add = c->font->em_scalef_x (tracking); foreach_grapheme (buffer, start, end) { - if (!(buffer->info[start].mask & trak_mask)) continue; buffer->pos[start].x_advance += advance_to_add; buffer->pos[start].x_offset += offset_to_add; } @@ -225,7 +222,6 @@ struct trak hb_position_t advance_to_add = c->font->em_scalef_y (tracking); foreach_grapheme (buffer, start, end) { - if (!(buffer->info[start].mask & trak_mask)) continue; buffer->pos[start].y_advance += advance_to_add; buffer->pos[start].y_offset += offset_to_add; } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 15f6c6abf..c8edb456f 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -123,10 +123,6 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, plan.kern_mask = plan.map.get_mask (kern_tag); plan.requested_kerning = !!plan.kern_mask; #endif -#ifndef HB_NO_AAT_SHAPE - plan.trak_mask = plan.map.get_mask (HB_TAG ('t','r','a','k')); - plan.requested_tracking = !!plan.trak_mask; -#endif bool has_gpos_kern = plan.map.get_feature_index (1, kern_tag) != HB_OT_LAYOUT_NO_FEATURE_INDEX; bool disable_gpos = plan.shaper->gpos_tag && @@ -212,7 +208,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, /* According to Ned, trak is applied by default for "modern fonts", as detected by presence of STAT table. */ #ifndef HB_NO_STYLE - plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face) && face->table.STAT->has_data (); + plan.apply_trak = hb_aat_layout_has_tracking (face) && face->table.STAT->has_data (); #else plan.apply_trak = false; #endif diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh index 78b0e2202..41fcfe80d 100644 --- a/src/hb-ot-shape.hh +++ b/src/hb-ot-shape.hh @@ -80,22 +80,12 @@ struct hb_ot_shape_plan_t #else static constexpr hb_mask_t kern_mask = 0; #endif -#ifndef HB_NO_AAT_SHAPE - hb_mask_t trak_mask; -#else - static constexpr hb_mask_t trak_mask = 0; -#endif #ifndef HB_NO_OT_KERN bool requested_kerning : 1; #else static constexpr bool requested_kerning = false; #endif -#ifndef HB_NO_AAT_SHAPE - bool requested_tracking : 1; -#else - static constexpr bool requested_tracking = false; -#endif #ifndef HB_NO_OT_SHAPE_FRACTIONS bool has_frac : 1; #else diff --git a/test/shape/data/in-house/tests/aat-trak.tests b/test/shape/data/in-house/tests/aat-trak.tests index b293fbc2e..ec49614ae 100644 --- a/test/shape/data/in-house/tests/aat-trak.tests +++ b/test/shape/data/in-house/tests/aat-trak.tests @@ -6,5 +6,3 @@ ../fonts/TRAK.ttf;--font-ptem=24;U+0041,U+0042,U+0043;[A.alt=0@-7,0+986|B=1@-7,0+986|C.alt=2@-7,0+986] ../fonts/TRAK.ttf;--font-ptem=72;U+0041,U+0042,U+0043;[A.alt=0@-36,0+929|B=1@-36,0+929|C.alt=2@-36,0+929] ../fonts/TRAK.ttf;--font-ptem=144;U+0041,U+0042,U+0043;[A.alt=0@-50,0+900|B=1@-50,0+900|C.alt=2@-50,0+900] -../fonts/TRAK.ttf;--font-ptem=144 --features=-trak;U+0041,U+0042,U+0043;[A.alt=0+1000|B=1+1000|C.alt=2+1000] -../fonts/TRAK.ttf;--font-ptem=144 --features=-trak[1:3];U+0041,U+0042,U+0043,U+0041,U+0042,U+0043;[A.alt=0@-50,0+900|B=1+1000|C.alt=2+1000|A.alt=3@-50,0+900|B=4@-50,0+900|C.alt=5@-50,0+900]