Created
May 24, 2017 11:53
-
-
Save gferreira/d06426d6c24fcf14fa9e02dac5e00a0d to your computer and use it in GitHub Desktop.
Convert a TrueType font to UFO with cubic outlines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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