2to3 --fix=print with manual fixup
diff --git a/Lib/fontTools/ttLib/tables/BitmapGlyphMetrics.py b/Lib/fontTools/ttLib/tables/BitmapGlyphMetrics.py
index 4aeaf4b..f5d0f02 100644
--- a/Lib/fontTools/ttLib/tables/BitmapGlyphMetrics.py
+++ b/Lib/fontTools/ttLib/tables/BitmapGlyphMetrics.py
@@ -47,7 +47,7 @@
if name in metricNames:
vars(self)[name] = safeEval(attrs['value'])
else:
- print "Warning: unknown name '%s' being ignored in %s." % name, self.__class__.__name__
+ print("Warning: unknown name '%s' being ignored in %s." % name, self.__class__.__name__)
class BigGlyphMetrics(BitmapGlyphMetrics):
diff --git a/Lib/fontTools/ttLib/tables/E_B_D_T_.py b/Lib/fontTools/ttLib/tables/E_B_D_T_.py
index 1563b98..2a1a0d8 100644
--- a/Lib/fontTools/ttLib/tables/E_B_D_T_.py
+++ b/Lib/fontTools/ttLib/tables/E_B_D_T_.py
@@ -167,7 +167,7 @@
assert glyphName not in bitmapGlyphDict, "Duplicate glyphs with the same name '%s' in the same strike." % glyphName
bitmapGlyphDict[glyphName] = curGlyph
else:
- print "Warning: %s being ignored by %s", name, self.__class__.__name__
+ print("Warning: %s being ignored by %s", name, self.__class__.__name__)
# Grow the strike data array to the appropriate size. The XML
# format allows the strike index value to be out of order.
@@ -197,7 +197,7 @@
if name in componentNames:
vars(self)[name] = safeEval(attrs['value'])
else:
- print "Warning: unknown name '%s' being ignored by EbdtComponent." % name
+ print("Warning: unknown name '%s' being ignored by EbdtComponent." % name)
# Helper functions for dealing with binary.
@@ -471,7 +471,7 @@
self.metrics = metricsClass()
self.metrics.fromXML(name, attrs, content, ttFont)
elif name == oppositeMetricsName:
- print "Warning: %s being ignored in format %d." % oppositeMetricsName, self.getFormat()
+ print("Warning: %s being ignored in format %d." % oppositeMetricsName, self.getFormat())
return BitmapPlusMetricsMixin
@@ -685,7 +685,7 @@
curComponent.fromXML(name, attrs, content, ttFont)
self.componentArray.append(curComponent)
else:
- print "Warning: '%s' being ignored in component array." % name
+ print("Warning: '%s' being ignored in component array." % name)
class ebdt_bitmap_format_8(BitmapPlusSmallMetricsMixin, ComponentBitmapGlyph):
diff --git a/Lib/fontTools/ttLib/tables/E_B_L_C_.py b/Lib/fontTools/ttLib/tables/E_B_L_C_.py
index 9371568..d2fc80a 100644
--- a/Lib/fontTools/ttLib/tables/E_B_L_C_.py
+++ b/Lib/fontTools/ttLib/tables/E_B_L_C_.py
@@ -294,7 +294,7 @@
elif name in dataNames:
vars(self)[name] = safeEval(attrs['value'])
else:
- print "Warning: unknown name '%s' being ignored in BitmapSizeTable." % name
+ print("Warning: unknown name '%s' being ignored in BitmapSizeTable." % name)
class SbitLineMetrics:
@@ -503,7 +503,7 @@
self.metrics = BigGlyphMetrics()
self.metrics.fromXML(name, attrs, content, ttFont)
elif name == SmallGlyphMetrics.__name__:
- print "Warning: SmallGlyphMetrics being ignored in format %d." % self.indexFormat
+ print("Warning: SmallGlyphMetrics being ignored in format %d." % self.indexFormat)
def padBitmapData(self, data):
# Make sure that the data isn't bigger than the fixed size.
diff --git a/Lib/fontTools/ttLib/tables/S_V_G_.py b/Lib/fontTools/ttLib/tables/S_V_G_.py
index 97d0b82..3b68b35 100644
--- a/Lib/fontTools/ttLib/tables/S_V_G_.py
+++ b/Lib/fontTools/ttLib/tables/S_V_G_.py
@@ -105,7 +105,7 @@
self.decompile_format_1(data, ttFont)
else:
if self.version != 0:
- print "Unknown SVG table version '%s'. Decompiling as version 0." % (self.version)
+ print("Unknown SVG table version '%s'. Decompiling as version 0." % (self.version))
self.decompile_format_0(data, ttFont)
@@ -306,7 +306,7 @@
if self.colorPalettes.numColorParams == 0:
self.colorPalettes = None
else:
- print "Unknown", name, content
+ print("Unknown", name, content)
class DocumentIndexEntry:
def __init__(self):
diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py
index 5a0679b..1a0a0cd 100644
--- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py
+++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py
@@ -33,7 +33,7 @@
format, length = struct.unpack(">HL", data[offset:offset+6])
if not length:
- print "Error: cmap subtable is reported as having zero length: platformID %s, platEncID %s, format %s offset %s. Skipping table." % (platformID, platEncID,format, offset)
+ print("Error: cmap subtable is reported as having zero length: platformID %s, platEncID %s, format %s offset %s. Skipping table." % (platformID, platEncID,format, offset))
continue
if format not in cmap_classes:
table = cmap_format_unknown(format)
diff --git a/Lib/fontTools/ttLib/tables/_m_a_x_p.py b/Lib/fontTools/ttLib/tables/_m_a_x_p.py
index 737af07..de6a29c 100644
--- a/Lib/fontTools/ttLib/tables/_m_a_x_p.py
+++ b/Lib/fontTools/ttLib/tables/_m_a_x_p.py
@@ -113,10 +113,10 @@
def testrepr(self):
items = sorted(self.__dict__.items())
- print ". . . . . . . . ."
+ print(". . . . . . . . .")
for combo in items:
- print " %s: %s" % combo
- print ". . . . . . . . ."
+ print(" %s: %s" % combo)
+ print(". . . . . . . . .")
def toXML(self, writer, ttFont):
if self.tableVersion != 0x00005000:
diff --git a/Lib/fontTools/ttLib/tables/_n_a_m_e.py b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
index b1ef1f4..aa5f966 100644
--- a/Lib/fontTools/ttLib/tables/_n_a_m_e.py
+++ b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
@@ -25,8 +25,7 @@
expectedStringOffset = 6 + n * nameRecordSize
if stringOffset != expectedStringOffset:
# XXX we need a warn function
- print "Warning: 'name' table stringOffset incorrect.",
- print "Expected: %s; Actual: %s" % (expectedStringOffset, stringOffset)
+ print("Warning: 'name' table stringOffset incorrect. Expected: %s; Actual: %s" % (expectedStringOffset, stringOffset))
stringData = data[stringOffset:]
data = data[6:]
self.names = []
diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py
index cac8a40..98bc2d4 100644
--- a/Lib/fontTools/ttLib/tables/otBase.py
+++ b/Lib/fontTools/ttLib/tables/otBase.py
@@ -45,12 +45,12 @@
if cachingStats:
stats = sorted([(v, k) for k, v in cachingStats.items()])
stats.reverse()
- print "cachingsstats for ", self.tableTag
+ print("cachingsstats for ", self.tableTag)
for v, k in stats:
if v < 2:
break
- print v, k
- print "---", len(stats)
+ print(v, k)
+ print("---", len(stats))
def compile(self, font):
""" Create a top-level OTFWriter for the GPOS/GSUB table.
diff --git a/Lib/fontTools/ttLib/tables/otConverters.py b/Lib/fontTools/ttLib/tables/otConverters.py
index 03a1a1f..b587022 100644
--- a/Lib/fontTools/ttLib/tables/otConverters.py
+++ b/Lib/fontTools/ttLib/tables/otConverters.py
@@ -225,8 +225,8 @@
return None
if offset <= 3:
# XXX hack to work around buggy pala.ttf
- print "*** Warning: offset is not 0, yet suspiciously low (%s). table: %s" \
- % (offset, self.tableClass.__name__)
+ print("*** Warning: offset is not 0, yet suspiciously low (%s). table: %s" \
+ % (offset, self.tableClass.__name__))
return None
table = self.tableClass()
table.reader = reader.getSubReader(offset)
diff --git a/Lib/fontTools/ttLib/tables/ttProgram.py b/Lib/fontTools/ttLib/tables/ttProgram.py
index 92dd0e2..5996b5c 100644
--- a/Lib/fontTools/ttLib/tables/ttProgram.py
+++ b/Lib/fontTools/ttLib/tables/ttProgram.py
@@ -406,5 +406,5 @@
p.fromBytecode(bc)
asm = p.getAssembly()
p.fromAssembly(asm)
- print bc == p.getBytecode()
+ print(bc == p.getBytecode())