Skip to content

Commit 7041e3c

Browse files
committed
Switch from a hand-written glyph outline decomposer to FreeType's one.
Instead of walking through FT_Outline ourselves, use FreeType's FT_Outline_Decompose to decompose glyphs into paths. Fixes incorrect positioning of first and last control points of certain contours; compare e.g. ```python from pylab import * from matplotlib.textpath import TextPath from matplotlib.patches import PathPatch rcParams["mathtext.fontset"] = "stixsans" path = TextPath((0, 0), r"$\delta$", size=72) plot(*path.vertices.T, ".-", lw=.5) gca().add_patch(PathPatch(path, alpha=.5)) gca().set(aspect="equal") show() ``` before and after the patch (before the patch, the inner loop was not properly closed). (Technically, I believe the earlier bug affected start/end-of-contours that are implicitly created per the ttf format at the midpoint two conic control points.) End-of-contours are now encoded as LINETOs instead of CLOSEPOLYs. Because contours are not stroked, this is fine. A few SVG files need to be updated too.
1 parent 7480805 commit 7041e3c

15 files changed

+3014
-3110
lines changed

lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_69.svg

+128-121
Loading

0 commit comments

Comments
 (0)