Skip to content
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

CurveIterator is wrong with curves starting with OFF point #199

Open
rbrich opened this issue Feb 14, 2017 · 1 comment
Open

CurveIterator is wrong with curves starting with OFF point #199

rbrich opened this issue Feb 14, 2017 · 1 comment

Comments

@rbrich
Copy link

rbrich commented Feb 14, 2017

According to freetype docs, the contour may start with conic off point. This case is not handled by CurveIterator, which assumes that first point is always on curve.

I encountered the problem with FreeSans.ttf, glyph "0". The inner contour has these tags: 00101001. The first point is conic off, so the last point should be used instead as the curve's starting point.

This is my render of the wrong outline:
screen shot 2017-02-14 at 10 59 01

Another example is the glyph for "8", the tags are 00010010010, ie. both ends of the contour are off-curve.

rbrich added a commit to rbrich/freetype-rs that referenced this issue Feb 14, 2017
@rbrich
Copy link
Author

rbrich commented Feb 26, 2017

Another bug is in ContourIterator.from_raw(). When outline.n_contours is 0, then last_end_idx is set to outline.contours.offset(-1) and the iterator crashes in next() method. This happens for space character, which has no countours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant