Converting ttf splines to otf splines

RoboFont Forums Help / General Converting ttf splines to otf splines

This topic contains 2 replies, has 2 voices, and was last updated by  bahman 6 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5744

    bahman
    Participant

    I opened my last created ufo file and RF asked me something about converting the splines, and I used one option without realizing what could happen. Now I got postscript splines when I’m working and in the generated font, splines are different from what I’ve designed and they are bad. I changed the spline conversion option in the font info but it does not change, it remains on “Persevere Curves, add points”. How could I get my postscript splines in the final .otf file without any new nodes or change? If RF has converted my splines to ttf format, how could I get them back?

    #5745

    frederik
    Keymaster

    RoboFont pops up a cubic < -> quad conversion warning whenever a UFO has mixed curves. It measures the amount of cubic segment and quad segments and propose the biggest number as default action to convert the whole font. RoboFont doesn’t allow mixed curves in a single UFO.

    The spline conversion option in the preferences are only used while generating a binary font.

    converting curve descriptions can be done with a script (please save you font first!)

    from lib.tools.bezierTools import curveConverter
    
    font = CurrentFont()
    
    coreFont = font.naked()
    
    for glyph in coreFont:
        # convert from cubic to quad
        curveConverter.bezier2quadratic(glyph)
        
        # convert from quad to cubic
        # curveConverter.quadratic2bezier(glyph)
        
    coreFont.segmentType = glyph.segmentType
    
    print "done"
    

    good luck

    #5749

    bahman
    Participant

    Thanks, that did it! :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.