diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index 19c2c2f34..9e51d3c1c 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -1177,16 +1177,14 @@ inline hb_blob_t* hb_resolve_overflows (const T& packed, hb_tag_t table_tag, unsigned max_rounds = 20) { - // Kahn sort is ~twice as fast as shortest distance sort and works for many fonts - // so try it first to save time. graph_t sorted_graph (packed); + sorted_graph.sort_shortest_distance (); + if (!sorted_graph.will_overflow ()) { return sorted_graph.serialize (); } - sorted_graph.sort_shortest_distance (); - if ((table_tag == HB_OT_TAG_GPOS || table_tag == HB_OT_TAG_GSUB) && sorted_graph.will_overflow ()) diff --git a/test/api/fonts/repacker_expected.otf b/test/api/fonts/repacker_expected.otf index d34cc87c1..f96fde0ca 100644 Binary files a/test/api/fonts/repacker_expected.otf and b/test/api/fonts/repacker_expected.otf differ