Fix a few issues found by landscape.io

This commit is contained in:
Behdad Esfahbod 2015-04-26 02:17:13 -04:00
parent f588727554
commit df2906b0ad
4 changed files with 4 additions and 3 deletions

View File

@ -705,7 +705,8 @@ _aglText = """\
""" """
AGLError = "AGLError" class AGLError(Exception):
pass
AGL2UV = {} AGL2UV = {}
UV2AGL = {} UV2AGL = {}

View File

@ -457,6 +457,7 @@ class FDSelect:
elif self.format == 3: elif self.format == 3:
gidArray = [None] * numGlyphs gidArray = [None] * numGlyphs
nRanges = readCard16(file) nRanges = readCard16(file)
fd = None
prev = None prev = None
for i in range(nRanges): for i in range(nRanges):
first = readCard16(file) first = readCard16(file)

View File

@ -680,7 +680,7 @@ class Options(object):
v = a[i+1:] v = a[i+1:]
k = k.replace('-', '_') k = k.replace('-', '_')
if not hasattr(self, k): if not hasattr(self, k):
if ignore_unknown == True or k in ignore_unknown: if ignore_unknown is True or k in ignore_unknown:
ret.append(orig_a) ret.append(orig_a)
continue continue
else: else:

View File

@ -319,7 +319,6 @@ def unpack_item(item):
return newitem return newitem
def suckfont(data): def suckfont(data):
import re
m = re.search(br"/FontName\s+/([^ \t\n\r]+)\s+def", data) m = re.search(br"/FontName\s+/([^ \t\n\r]+)\s+def", data)
if m: if m:
fontName = m.group(1) fontName = m.group(1)