예제 #1
0
 def glifToPy(self, glif):
     glif = stripText(glif)
     glif = "<?xml version=\"1.0\"?>\n" + glif
     glyph = Glyph()
     readGlyphFromString(glif,
                         glyphObject=glyph,
                         pointPen=glyph,
                         validate=True)
     return glyph.py()
예제 #2
0
	def pyToGLIF(self, py):
		py = stripText(py)
		glyph = Glyph()
		exec py in {"glyph" : glyph, "pointPen" : glyph}
		glif = writeGlyphToString(glyph.name, glyphObject=glyph, drawPointsFunc=glyph.drawPoints, formatVersion=1)
		glif = "\n".join(glif.splitlines()[1:])
		return glif
예제 #3
0
 def pyToGLIF(self, py):
     py = stripText(py)
     glyph = Glyph()
     exec(py, {"glyph": glyph, "pointPen": glyph})
     glif = writeGlyphToString(glyph.name,
                               glyphObject=glyph,
                               drawPointsFunc=glyph.drawPoints,
                               formatVersion=1,
                               validate=True)
     # discard the first line containing the xml declaration
     return "\n".join(islice(glif.splitlines(), 1, None))
예제 #4
0
	def glifToPy(self, glif):
		glif = stripText(glif)
		glif = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + glif
		glyph = Glyph()
		readGlyphFromString(glif, glyphObject=glyph, pointPen=glyph)
		return glyph.py()
예제 #5
0
 def glifToPy(self, glif):
     glif = stripText(glif)
     glif = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + glif
     glyph = Glyph()
     readGlyphFromString(glif, glyphObject=glyph, pointPen=glyph)
     return glyph.py()