New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[glyf-1 cubic curves] Last cubic segment becomes quadratic #3189
Comments
Thanks. Pretty sure it's in |
Is this an on-curve-less outline? |
No, it's an ordinary mix of on-curve and off-curve points. |
I can take a look if you send me a font. |
The bug is in from fontTools.pens.ttGlyphPen import TTGlyphPen, TTGlyphPointPen
from fontTools.pens.recordingPen import RecordingPointPen
points = [
((0, 0), "curve"),
((0, 0), None),
((0, 0), None),
((0, 0), "curve"),
((0, 0), None),
((0, 0), None),
]
if True:
pen = TTGlyphPointPen(None)
pen.beginPath()
for (x, y), segmentType in points:
pen.addPoint((x, y), segmentType=segmentType)
pen.endPath()
else:
pen = TTGlyphPen(None)
pen.moveTo((0, 0))
pen.curveTo((0, 0), (0, 0), (0, 0))
pen.curveTo((0, 0), (0, 0), (0, 0))
pen.closePath()
glyph = pen.glyph()
rpen = RecordingPointPen()
glyph.drawPoints(rpen, None)
for m, args, kwargs in rpen.value:
if args:
pt, tp, *_ = args
print(m, pt, tp)
else:
print(m) In both cases, the output is:
Where the first segmentType should be "curve" instead of "qcurve". |
Hm, maybe the bug is with |
Indeed:
|
Can you check with #3190 |
Yup, that fixes it, thanks! |
This is happening when drawing a variable composite glyph from a TTGlyphSet onto a TTGlyphPointPen. All outlines are cubic in the source. The bug is either in the TTGlyphSet code or in TTGlyphPointPen. Or somewhere else. (I will dig deeper, and fix if I can.)
The text was updated successfully, but these errors were encountered: