SOLVED RoboFont will convert TrueType splines to splines with 2 offcurve points.
-
Hello,
when I import a path from TrueType that has more than 2 offcurve points per segment, RoboFont throws an error. I guess that UFO can't store quadratic segments with more than 2 offcurve points, right?RoboFont will convert TrueType splines to splines with 2 offcurve points.
After submitting the pop up window with the message above it fixes it. How can I access it programmatically? So I can correct all inserted contours? Ideally before adding them to the font.
Thanks
-
After some work I realized that I need to keep everything as it is, only change from cubic to quadratic or the other way round. I went for cubic -> quadratic. The conversion doesn't has to be perfect. All tools add extra points. I found out that the simplest conversion from cubic to quadratic is to offset offcurve points to 75% of their lengths.
I am using brutal way of changing it with xml parser.
I see that when I
cmd + c
a cubic contour to quadratic or the other way around font I get the desired result, which I am not able to access via code though.
-
UFO has full support for quads.
RoboFont converts them curves with 2 offcurves, its not an error but a message informing you that this happens. All added points have a tag.
The plan is to remove this limitation in future RoboFonts, as quads become more important...
-
https://github.com/googlefonts/robotoslab/blob/master/scripts/bin/ufo-qu2cu
this worked well for me
and as they say
class SimpleQu2CuPen(BasePen): """BasePen will make a simple conversion from quadratic to cubic."""