> > I don't fully understand this code. > > that is an ominous comment to come from the Freetype > author. I had assumed you reviewed the existing code > as well.
I have two difficulties: I'm not good at C++ and Guile stuff, and it's not completely clear to me what the code wants to achieve. It's not your recent changes that I'm struggling with but the overall design. What's definitely missing is handling the case where the first point of an outline is a (second-order) off-curve point, making it necessary to construct an on-curve point if the point before (i.e., the last point of the current contour) is a (second order) off-curve point, too. On the other hand, we talked about approximating the outlines by using the hull polygon that is spanned by the control points: If you do this the construction of the on-curve point wouldn't be necessary, right? Does your code change in commit 79ec62e6 do that already? The comment only says 'Substitute a line segment instead' but doesn't explain whether this is a legitimate approximation. > > A quite well documented routine to walk over a contour is function > > `FT_Outline_Decompose` in file `src/base/ftoutln.c` of the FreeType source > code. > > I'll have a look. Thanks. Note that the first point of a contour can never be a third-order off-curve point, which means that you don't need to handle wrapping in this case. https://codereview.appspot.com/566080043/