[trak] Remove support for disabling using pseudo-font-feature

Fixes https://github.com/harfbuzz/harfbuzz/issues/5052
This commit is contained in:
Behdad Esfahbod 2025-02-09 04:16:57 +00:00
parent 4c06c3d606
commit 1150d4bf12
4 changed files with 1 additions and 21 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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]