From df2906b0ad0d9c7d0484f5aaa578188dcbd03916 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Apr 2015 02:17:13 -0400 Subject: [PATCH] Fix a few issues found by landscape.io --- Lib/fontTools/agl.py | 3 ++- Lib/fontTools/cffLib.py | 1 + Lib/fontTools/merge.py | 2 +- Lib/fontTools/misc/psLib.py | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/agl.py b/Lib/fontTools/agl.py index e51d50725..11161c702 100644 --- a/Lib/fontTools/agl.py +++ b/Lib/fontTools/agl.py @@ -705,7 +705,8 @@ _aglText = """\ """ -AGLError = "AGLError" +class AGLError(Exception): + pass AGL2UV = {} UV2AGL = {} diff --git a/Lib/fontTools/cffLib.py b/Lib/fontTools/cffLib.py index 3169d4878..b0dee0980 100644 --- a/Lib/fontTools/cffLib.py +++ b/Lib/fontTools/cffLib.py @@ -457,6 +457,7 @@ class FDSelect: elif self.format == 3: gidArray = [None] * numGlyphs nRanges = readCard16(file) + fd = None prev = None for i in range(nRanges): first = readCard16(file) diff --git a/Lib/fontTools/merge.py b/Lib/fontTools/merge.py index 248589f2e..d8d1f62b9 100644 --- a/Lib/fontTools/merge.py +++ b/Lib/fontTools/merge.py @@ -680,7 +680,7 @@ class Options(object): v = a[i+1:] k = k.replace('-', '_') 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) continue else: diff --git a/Lib/fontTools/misc/psLib.py b/Lib/fontTools/misc/psLib.py index 0bba4d3ce..2139a066d 100644 --- a/Lib/fontTools/misc/psLib.py +++ b/Lib/fontTools/misc/psLib.py @@ -319,7 +319,6 @@ def unpack_item(item): return newitem def suckfont(data): - import re m = re.search(br"/FontName\s+/([^ \t\n\r]+)\s+def", data) if m: fontName = m.group(1)