def _decompose(glyph): components = glyph.components font = glyph.getParent() decomposedGlyph = RGlyph() if font is not None: for component in components: decomponent = RGlyph() decomponent.appendGlyph(font[component.baseGlyph]) decomponent.scale((component.scale[0], component.scale[1])) decomponent.move((component.offset[0], component.offset[1])) decomposedGlyph.appendGlyph(decomponent) for contour in glyph.contours: decomposedGlyph.appendContour(contour) decomposedGlyph.width = glyph.width return decomposedGlyph
drawPath(path) def _decompose(glyph): components = glyph.components font = glyph.getParent() decomposedGlyph = RGlyph() if font is not None: for component in components: decomponent = RGlyph() decomponent.appendGlyph(font[component.baseGlyph]) decomponent.scale((component.scale[0], component.scale[1])) decomponent.move((component.offset[0], component.offset[1])) decomposedGlyph.appendGlyph(decomponent) for contour in glyph.contours: decomposedGlyph.appendContour(contour) decomposedGlyph.width = glyph.width return decomposedGlyph class TypeSetter(object): def __init__(self, thisFont): if thisFont is None: return self.thisFont = thisFont self.cmap = thisFont.getCharacterMapping() self.getGroups = thisFont.groups.findGlyph self.kerning = thisFont.kerning self.preset = 'A4-P' self.type = {