[repack] always run the sort in repack.
This is needed to ensure virtual link ordering constraints are respected when repack is being called from fontTools. For subset usage, repack won't be called if the graph doesn't already overflow so this change doesn't cause any extra work.
diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh
index 19c2c2f..9e51d3c 100644
--- a/src/hb-repacker.hh
+++ b/src/hb-repacker.hh
@@ -1177,16 +1177,14 @@
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 ())