Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 def getGlyphs(self):
     return [TFSGlyph(glyph) for glyph in self.rffont]
Beispiel #4
0
 def getGlyphByCodePoint(self, value):
     for glyph in self.rffont:
         if glyph.unicode == value:
             return TFSGlyph(glyph)
     return None
Beispiel #5
0
 def getGlyphByName(self, key):
     rfglyph = self.rffont.getGlyph(key)
     return TFSGlyph(rfglyph)
Beispiel #6
0
 def insertGlyphDerivedFromGlyph(self, codePoint, contours, srcGlyph):
     import UnicodeCharacterNames
     name = UnicodeCharacterNames.getUnicodeCharacterName(codePoint)
     glyph = TFSGlyph(self.rffont.newGlyph(name))
     glyph.updateDerivedFromGlyph(codePoint, contours, srcGlyph)
 def insertGlyphDerivedFromGlyph(self, codePoint, contours, srcGlyph):
     import UnicodeCharacterNames
     name = UnicodeCharacterNames.getUnicodeCharacterName(codePoint)
     glyph = TFSGlyph(self.rffont.newGlyph(name))
     glyph.updateDerivedFromGlyph(codePoint, contours, srcGlyph)