mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 18:13:53 +01:00
[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:
1 parent
372119f1df
commit
1e6ea99af7
5 files changed
+26
-1
No files matched your search
@@ -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;
|
||||
|
||||
BIN
Binary file not shown.
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
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user