Skip to content

Instantly share code, notes, and snippets.

@roberto-arista
Created February 5, 2019 10:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberto-arista/e916e3c9c0ab445b2bfb714af80dab6b to your computer and use it in GitHub Desktop.
Save roberto-arista/e916e3c9c0ab445b2bfb714af80dab6b to your computer and use it in GitHub Desktop.
import fontParts.world as fp
from fontTools.pens.cocoaPen import CocoaPen
def drawGlyph(glyph):
pen = CocoaPen(glyph.getParent())
glyph.draw(pen)
path = pen.path
glyphPath = BezierPath(path=path)
drawPath(glyphPath)
myFont = fp.OpenFont('someFont.ufo')
drawGlyph(myFont['a'])
@typemytype
Copy link

import fontParts.world as fp

def drawGlyph(glyph):
    glyphPath = BezierPath(glyphSet=glyph.layer)
    glyph.draw(glyphPath)    
    drawPath(glyphPath)
    

myFont = fp.OpenFont('someFont.ufo')
drawGlyph(myFont['a'])

@roberto-arista
Copy link
Author

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment