diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 59b97a799..e507d2f3e 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -46,6 +46,8 @@ #include "hb-set.hh" #include "hb-aat-layout.hh" +#include "hb-ot-stat-table.hh" + static inline bool _hb_codepoint_is_regional_indicator (hb_codepoint_t u) @@ -208,8 +210,8 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, if (plan.apply_morx) plan.adjust_mark_positioning_when_zeroing = false; - /* Currently we always apply trak. */ - plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face); + /* According to Ned, trak is applied by default for "modern fonts", as detected by presence of STAT table. */ + plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face) && face->table.STAT->has_data (); #endif } diff --git a/test/shape/data/in-house/fonts/TRAK.ttf b/test/shape/data/in-house/fonts/TRAK.ttf index 07ae3afd8..3be9c0085 100644 Binary files a/test/shape/data/in-house/fonts/TRAK.ttf and b/test/shape/data/in-house/fonts/TRAK.ttf differ