Exemplo n.º 1
0
def finalContours(junk,glyph):
  glyph = fontforge.activeGlyph()
  glyph.round()
  glyph.addExtrema("all")
  glyph.simplify()
  glyph.simplify()
  glyph.correctDirection()
  print "Finalised %s" % glyph.glyphname
Exemplo n.º 2
0
def finalContours(junk,glyph):
  glyph = fontforge.activeGlyph()
  glyph.round()
  glyph.addExtrema("all")
  glyph.simplify()
  glyph.simplify()
  glyph.correctDirection()
  print "Finalised %s" % glyph.glyphname
Exemplo n.º 3
0
# fontforge.loadNamelist()
# fontforge.loadNamelistDir()
# fontforge.preloadCidmap()

fontforge.printSetup("lpr")

if (fontforge.unicodeFromName("A")!=65) or (fontforge.unicodeFromName("uni030D")!=0x30D):
  raise ValueError("Wrong return from unicodeFromName")

foo = fontforge.version()

ambrosia = sys.argv[1]

fonts = fontforge.fonts()
if ( len(fonts)!=0 ) :
  raise ValueError("Wrong return from fontforge.fonts")

fontforge.activeFont()
fontforge.activeGlyph()
fontforge.activeLayer()
fontnames= fontforge.fontsInFile(ambrosia)
if len(fontnames)!=1 or fontnames[0]!='Ambrosia':
  raise ValueError("Wrong return from fontforge.fontsInFile")
font = fontforge.open(ambrosia)
morefonts = fontforge.fonts()
if len(morefonts)!=1:
  raise ValueError("Wrong return from fontforge.fonts")

instrs = fontforge.parseTTInstrs("SRP0\nMIRP[min,rnd,black]")
print(fontforge.unParseTTInstrs(instrs))