[repacker] fix bug with original count in liga splitting.

This commit is contained in:
Garret Rieger committed 2025-07-08 21:29:48 +00:00
1 parent 96fedd88fe
commit 4fa5788cfd
1 file changed
+16 -10
+16 -10
View File
@@ -77,11 +77,25 @@ struct LigatureSubstFormat1 : public OT::Layout::GSUB_impl::LigatureSubstFormat1
c,
this,
c.graph.duplicate_if_shared (parent_index, this_index),
total_number_ligas(c, this_index),
};
return actuate_subtable_split<split_context_t> (split_context, split_points);
}
private:
unsigned total_number_ligas(gsubgpos_graph_context_t& c, unsigned this_index) const {
unsigned total = 0;
for (unsigned i = 0; i < ligatureSet.len; i++)
{
auto liga_set = c.graph.as_table<LigatureSet>(this_index, &ligatureSet[i]);
if (!liga_set.table) {
return 0;
}
total += liga_set.table->ligature.len;
}
return total;
}
hb_vector_t<unsigned> compute_split_points(gsubgpos_graph_context_t& c,
unsigned parent_index,
unsigned this_index) const
@@ -137,19 +151,11 @@ struct LigatureSubstFormat1 : public OT::Layout::GSUB_impl::LigatureSubstFormat1
gsubgpos_graph_context_t& c;
LigatureSubstFormat1* thiz;
unsigned this_index;
unsigned original_count_;
unsigned original_count ()
{
unsigned total = 0;
for (unsigned i = 0; i < thiz->ligatureSet.len; i++)
{
auto liga_set = c.graph.as_table<LigatureSet>(this_index, &thiz->ligatureSet[i]);
if (!liga_set.table) {
return 0;
}
total += liga_set.table->ligature.len;
}
return total;
return original_count_;
}
unsigned clone_range (unsigned start, unsigned end)