From 01c0cc941757716dfb4162817cfa8a37362c62a1 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sat, 5 Jul 2014 23:02:34 +0300 Subject: [PATCH] Remove unused WIP save2() from pre-fork days --- PIL/FontFile.py | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/PIL/FontFile.py b/PIL/FontFile.py index 7c5704c9d..26ddff0ac 100644 --- a/PIL/FontFile.py +++ b/PIL/FontFile.py @@ -17,8 +17,6 @@ import os from PIL import Image, _binary -import marshal - try: import zlib except ImportError: @@ -26,6 +24,7 @@ except ImportError: WIDTH = 800 + def puti16(fp, values): # write network order (big-endian) 16-bit sequence for v in values: @@ -33,6 +32,7 @@ def puti16(fp, values): v += 65536 fp.write(_binary.o16be(v)) + ## # Base class for raster font file handlers. @@ -95,9 +95,8 @@ class FontFile: # print chr(i), dst, s self.metrics[i] = d, dst, s - - def save1(self, filename): - "Save font in version 1 format" + def save(self, filename): + "Save font" self.compile() @@ -107,7 +106,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,30 +116,4 @@ class FontFile: puti16(fp, m[0] + m[1] + m[2]) fp.close() - - def save2(self, filename): - "Save font in version 2 format" - - # THIS IS WORK IN PROGRESS - - self.compile() - - data = marshal.dumps((self.metrics, self.info)) - - if zlib: - data = b"z" + zlib.compress(data, 9) - else: - data = b"u" + data - - fp = open(os.path.splitext(filename)[0] + ".pil", "wb") - - fp.write(b"PILfont2\n" + self.name + "\n" + "DATA\n") - - fp.write(data) - - self.bitmap.save(fp, "PNG") - - fp.close() - - - save = save1 # for now +# End of file