Commit 4469385
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 between two conic control points.)
A few SVG files need to be updated too.1 parent 7480805 commit 4469385
15 files changed
Lines changed: 3154 additions & 3061 deletions
File tree
- lib/matplotlib/tests/baseline_images/test_mathtext
- src
Lines changed: 129 additions & 114 deletions
Loading
0 commit comments