diff options
Diffstat (limited to 'Lib/fontTools/ttLib/tables/M_E_T_A_.py')
-rw-r--r-- | Lib/fontTools/ttLib/tables/M_E_T_A_.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/fontTools/ttLib/tables/M_E_T_A_.py b/Lib/fontTools/ttLib/tables/M_E_T_A_.py index 862487f7..d4f6bc8c 100644 --- a/Lib/fontTools/ttLib/tables/M_E_T_A_.py +++ b/Lib/fontTools/ttLib/tables/M_E_T_A_.py @@ -1,4 +1,4 @@ -from fontTools.misc.py23 import * +from fontTools.misc.py23 import byteord from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval from . import DefaultTable @@ -173,7 +173,7 @@ class table_M_E_T_A_(DefaultTable.DefaultTable): glyphRec = GlyphRecord() self.glyphRecords.append(glyphRec) for element in content: - if isinstance(element, basestring): + if isinstance(element, str): continue name, attrs, content = element glyphRec.fromXML(name, attrs, content, ttFont) @@ -207,7 +207,7 @@ class GlyphRecord(object): stringRec = StringRecord() self.stringRecs.append(stringRec) for element in content: - if isinstance(element, basestring): + if isinstance(element, str): continue stringRec.fromXML(name, attrs, content, ttFont) stringRec.stringLen = len(stringRec.string) @@ -229,7 +229,7 @@ class GlyphRecord(object): # XXX The following two functions are really broken around UTF-8 vs Unicode def mapXMLToUTF8(string): - uString = unicode() + uString = str() strLen = len(string) i = 0 while i < strLen: @@ -245,9 +245,9 @@ def mapXMLToUTF8(string): i = i+1 valStr = string[j:i] - uString = uString + unichr(eval('0x' + valStr)) + uString = uString + chr(eval('0x' + valStr)) else: - uString = uString + unichr(byteord(string[i])) + uString = uString + chr(byteord(string[i])) i = i +1 return uString.encode('utf_8') @@ -281,7 +281,7 @@ class StringRecord(object): def fromXML(self, name, attrs, content, ttFont): for element in content: - if isinstance(element, basestring): + if isinstance(element, str): continue name, attrs, content = element value = attrs["value"] |