ugh, the zfill string method doesn't exist in 2.2.1 and earlier :-(
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@366 4cde692c-a291-49d1-8350-778aa11640f8
diff --git a/Doc/changes.txt b/Doc/changes.txt
index 494b845..216aae5 100644
--- a/Doc/changes.txt
+++ b/Doc/changes.txt
@@ -1,5 +1,8 @@
TTX/FontTools Version 2.0 beta 2 (released ??? 2002)
+- Fixed ttx -l: it turned out this part of the code didn't work with
+ Python 2.2.1 and earlier. My bad to do most of my testing with a
+ different version than I shipped TTX with :-(
- Fixed bug in ClassDef format 1 subtable (Andreas Seidel bumped into
this one).
diff --git a/Lib/fontTools/ttx.py b/Lib/fontTools/ttx.py
index 435b426..75a02b1 100644
--- a/Lib/fontTools/ttx.py
+++ b/Lib/fontTools/ttx.py
@@ -128,6 +128,7 @@
def ttList(input, output, options):
+ import string
ttf = TTFont(input)
reader = ttf.reader
tags = reader.keys()
@@ -138,7 +139,7 @@
print format % ("----", "----------", "-------", "-------")
for tag in tags:
entry = reader.tables[tag]
- checksum = "0x" + hex(entry.checkSum)[2:].zfill(8)
+ checksum = "0x" + string.zfill(hex(entry.checkSum)[2:], 8)
print format % (tag, checksum, entry.length, entry.offset)
print
ttf.close()