def insertGlyph(self, codePoint, contours, xAdvance, glyphName=None, correctDirection=True): if glyphName is None: glyphName = self.getGlyphName(codePoint) glyph = TFSGlyph(self.rffont.newGlyph(glyphName)) if codePoint is not None: glyph.setUnicode(codePoint) glyph.setContours(contours, correctDirection=correctDirection) glyph.setXAdvance(xAdvance) glyph.update() # glyph.correctDirection() return glyph
def getGlyphs(self): return [TFSGlyph(glyph) for glyph in self.rffont]
def getGlyphByCodePoint(self, value): for glyph in self.rffont: if glyph.unicode == value: return TFSGlyph(glyph) return None
def getGlyphByName(self, key): rfglyph = self.rffont.getGlyph(key) return TFSGlyph(rfglyph)
def insertGlyphDerivedFromGlyph(self, codePoint, contours, srcGlyph): import UnicodeCharacterNames name = UnicodeCharacterNames.getUnicodeCharacterName(codePoint) glyph = TFSGlyph(self.rffont.newGlyph(name)) glyph.updateDerivedFromGlyph(codePoint, contours, srcGlyph)