This commit is contained in:
hugovk 2014-07-05 22:33:21 +03:00
parent 8cbe60f816
commit dff86fc23f

View File

@ -26,6 +26,7 @@ except ImportError:
WIDTH = 800
def puti16(fp, values):
# write network order (big-endian) 16-bit sequence
for v in values:
@ -33,6 +34,7 @@ def puti16(fp, values):
v += 65536
fp.write(_binary.o16be(v))
##
# Base class for raster font file handlers.
@ -95,7 +97,6 @@ class FontFile:
# print chr(i), dst, s
self.metrics[i] = d, dst, s
def save1(self, filename):
"Save font in version 1 format"
@ -107,7 +108,7 @@ class FontFile:
# font metrics
fp = open(os.path.splitext(filename)[0] + ".pil", "wb")
fp.write(b"PILfont\n")
fp.write((";;;;;;%d;\n" % self.ysize).encode('ascii')) # HACK!!!
fp.write((";;;;;;%d;\n" % self.ysize).encode('ascii')) # HACK!!!
fp.write(b"DATA\n")
for id in range(256):
m = self.metrics[id]
@ -117,7 +118,6 @@ class FontFile:
puti16(fp, m[0] + m[1] + m[2])
fp.close()
def save2(self, filename):
"Save font in version 2 format"
@ -142,5 +142,4 @@ class FontFile:
fp.close()
save = save1 # for now
save = save1 # for now