Skip to content

Instantly share code, notes, and snippets.

@gferreira
Created May 24, 2017 11:53
Show Gist options
  • Save gferreira/d06426d6c24fcf14fa9e02dac5e00a0d to your computer and use it in GitHub Desktop.
Save gferreira/d06426d6c24fcf14fa9e02dac5e00a0d to your computer and use it in GitHub Desktop.
Convert a TrueType font to UFO with cubic outlines
import extractor
import defcon
ttf_path = u"/Library/Fonts/Georgia.ttf"
ufo_path = u"/Users/gferreira/Documents/test.ufo"
ufo = defcon.Font()
extractor.extractUFO(ttf_path, ufo)
from lib.tools.bezierTools import curveConverter
for glyph in ufo:
curveConverter.quadratic2bezier(glyph)
ufo.segmentType = glyph.segmentType
ufo.save(ufo_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment