mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 17:19:17 +01:00
[subset] Use outline bounds for instanced CFF2 metrics (#6469)
The bounds vectors used to rebuild hhea and vhea expect non-negative widths and heights, with a sentinel for glyphs without outlines. CFF2 instancing stored negative extents.height values and replaced the sentinel for empty glyphs. Store yMax - yMin and preserve empty bounds. Regenerate the three affected expected fonts through the subset test generator. Only header metrics and checksums change. The new vhea values agree with FontTools recalculation from the glyph outlines. Both affected test cases fail without the source fix; the full Meson suite passes with it (293 tests). Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-3LQ6CVVN. Assisted-by: OpenAI Codex
This commit is contained in:
1 parent
879be16fdf
commit
be6b6ab2b5
4 files changed
+4
-2
No files matched your search
@@ -755,7 +755,8 @@ update_instance_metrics_map_from_cff2 (hb_subset_plan_t *plan)
|
||||
_hmtx.get_leading_bearing_without_var_unscaled (old_gid, &lsb);
|
||||
}
|
||||
plan->hmtx_map.set (new_gid, hb_pair ((unsigned) hori_aw, lsb));
|
||||
plan->bounds_width_vec[new_gid] = extents.width;
|
||||
if (has_bounds_info)
|
||||
plan->bounds_width_vec[new_gid] = extents.width;
|
||||
}
|
||||
|
||||
if (_vmtx.has_data ())
|
||||
@@ -777,7 +778,8 @@ update_instance_metrics_map_from_cff2 (hb_subset_plan_t *plan)
|
||||
}
|
||||
|
||||
plan->vmtx_map.set (new_gid, hb_pair ((unsigned) vert_aw, tsb));
|
||||
plan->bounds_height_vec[new_gid] = extents.height;
|
||||
if (has_bounds_info)
|
||||
plan->bounds_height_vec[new_gid] = hb_saturate_neg (extents.height);
|
||||
}
|
||||
}
|
||||
/* No glyph contributed bounds: do not serialize the accumulator's
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in new issue
Block a user