[subset] Preserve deltas when a contour exceeds the IUP set limit (#6344)

The IUP optimizer returns success for contours larger than its 512-bit
sets can represent, leaving every optimized reference false. The
resulting partial instance loses the contour's variation data.

Keep all explicit references when skipping optimization at that limit.
This preserves the existing bounded search without changing geometry.

Add a 600-point contour regression. The original subsetter fails both
normal and preprocessed checks. The entire configured Meson suite
passes (278 tests, one skipped).

Assisted-by: Codex
This commit is contained in:
Behdad Esfahbod authored and GitHub committed 2026-10-10 00:36:51 -06:00
1 parent 372119f1df
commit 1e6ea99af7
5 files changed
+26 -1

No files matched your search

+7 -1
View File
@@ -362,7 +362,13 @@ static bool _iup_contour_optimize (const hb_array_t<const contour_point_t> conto
return false;
if (unlikely (n > hb_iup_set_t::PAGE_BITS))
return true; // Refuse to work
{
/* The forced and solution sets cannot hold this contour. Preserve
* its explicit deltas instead of leaving every reference false. */
for (unsigned i = 0; i < n; i++)
opt_indices.arrayZ[i] = true;
return true;
}
bool all_within_tolerance = true;
double tolerance_sq = tolerance * tolerance;
Binary file not shown.
@@ -0,0 +1,18 @@
# A 600-point contour exceeds the IUP bitset limit; keep dense deltas.
FONTS:
IUP-large-contour.ttf
PROFILES:
default.txt
SUBSETS:
*
INSTANCES:
wght=400:900
IUP_OPTIONS:
Yes
OPTIONS:
no_fonttools
+1
View File
@@ -80,6 +80,7 @@ tests = [
'instantiate_cff2_update_metrics',
'layout.empty_ligature_offset',
'glyf_partial_instancing',
'glyf_iup_large_contour',
'hvar_partial_instance_implicit_map',
'mvar_partial_instance',
'update_def_wght',