Author :
Werner Lemberg
Date :
2025-05-12 08:28:55
Hash :fd66a29d Message :[autofit] New algorithm for preventing hinting of tilde glyphs.
The old algorithm removed segments from edges to make the auto-hinter ignore
a tilde. However, the implementation had two flaws.
- Edge array elements were moved around without reordering them afterwards.
- The linking between edges and segments wasn't correctly updated for moved
edges, which could cause endless loops.
Correcting both problems are non-trivial; additionally, a fix would make
the auto-hinter slower.
For these reasons, a new, simpler approach is taken: A new flag allows
points to be tagged as being ignored, and if such a point is enountered, it
doesn't get added to a segment.
Fixes issue #1333.
* src/autofit/afhints.h (AF_FLAG_IGNORE): New macro.
* src/autofit/aflatin.c (af_latin_hints_compute_segments, af_touch_contour):
Use it.
(af_remove_segments_containing_point, af_remove_top_points_from_edges,
af_remove_bottom_points_from_edges): Removed.
(af_latin_stretch_top_tilde): Call `af_touch_top_contours` and
`af_touch_bottom_contours` unconditionally.
(af_latin_hints_apply): Updated.