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
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
################# def _drawGlyph(glyph): path = glyph.naked().getRepresentation("defconAppKit.NSBezierPath") 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()