a few cosmetic/style changes
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@206 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
1940dfbe0e
commit
22dcb9e6f9
@ -42,7 +42,7 @@ Dumping 'prep' table...
|
||||
"""
|
||||
|
||||
#
|
||||
# $Id: __init__.py,v 1.22 2002-05-05 11:29:33 jvr Exp $
|
||||
# $Id: __init__.py,v 1.23 2002-05-10 19:03:34 jvr Exp $
|
||||
#
|
||||
|
||||
import os
|
||||
@ -221,9 +221,7 @@ class TTFont:
|
||||
else:
|
||||
writer.begintag(xmltag)
|
||||
writer.newline()
|
||||
if tag == "glyf":
|
||||
table.toXML(writer, self, progress)
|
||||
elif tag == "CFF ":
|
||||
if tag in ("glyf", "CFF "):
|
||||
table.toXML(writer, self, progress)
|
||||
else:
|
||||
table.toXML(writer, self)
|
||||
|
@ -1,6 +1,8 @@
|
||||
import DefaultTable
|
||||
import sstruct
|
||||
from fontTools.misc.textTools import safeEval, num2binary, binary2num
|
||||
from types import TupleType
|
||||
|
||||
|
||||
# panose classification
|
||||
|
||||
@ -152,7 +154,7 @@ class table_O_S_2f_2(DefaultTable.DefaultTable):
|
||||
if name == "panose":
|
||||
self.panose = panose = Panose()
|
||||
for element in content:
|
||||
if type(element) == type(()):
|
||||
if type(element) == TupleType:
|
||||
panose.fromXML(element, ttFont)
|
||||
elif name in ("ulUnicodeRange1", "ulUnicodeRange2",
|
||||
"ulUnicodeRange3", "ulUnicodeRange4",
|
||||
|
@ -4,6 +4,7 @@ import string
|
||||
import array
|
||||
from fontTools import ttLib
|
||||
from fontTools.misc.textTools import safeEval, readHex
|
||||
from types import TupleType
|
||||
|
||||
|
||||
class table__c_m_a_p(DefaultTable.DefaultTable):
|
||||
@ -153,7 +154,7 @@ class cmap_format_0(CmapSubtable):
|
||||
self.version = safeEval(attrs["version"])
|
||||
self.cmap = {}
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name <> "map":
|
||||
@ -307,7 +308,7 @@ class cmap_format_4(CmapSubtable):
|
||||
self.version = safeEval(attrs["version"])
|
||||
self.cmap = {}
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name <> "map":
|
||||
@ -372,7 +373,7 @@ class cmap_format_6(CmapSubtable):
|
||||
self.version = safeEval(attrs["version"])
|
||||
self.cmap = {}
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name <> "map":
|
||||
|
@ -21,7 +21,8 @@ from fontTools.misc.textTools import safeEval, readHex
|
||||
import ttProgram
|
||||
import array
|
||||
import Numeric
|
||||
import types
|
||||
from types import StringType, TupleType
|
||||
|
||||
|
||||
class table__g_l_y_f(DefaultTable.DefaultTable):
|
||||
|
||||
@ -105,7 +106,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
|
||||
if name == "GlyphOrder":
|
||||
glyphOrder = []
|
||||
for element in content:
|
||||
if type(element) == types.StringType:
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name == "GlyphID":
|
||||
@ -125,7 +126,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
|
||||
setattr(glyph, attr, safeEval(attrs.get(attr, '0')))
|
||||
self.glyphs[glyphName] = glyph
|
||||
for element in content:
|
||||
if type(element) == types.StringType:
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
glyph.fromXML(element, ttFont)
|
||||
if not ttFont.recalcBBoxes:
|
||||
@ -281,7 +282,7 @@ class Glyph:
|
||||
coordinates = []
|
||||
flags = []
|
||||
for element in content:
|
||||
if type(element) == types.StringType:
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name <> "pt":
|
||||
@ -310,7 +311,7 @@ class Glyph:
|
||||
elif name == "instructions":
|
||||
self.program = ttProgram.Program()
|
||||
for element in content:
|
||||
if type(element) == types.StringType:
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
self.program.fromXML(element, ttFont)
|
||||
|
||||
@ -801,7 +802,7 @@ class GlyphComponent:
|
||||
|
||||
def reprflag(flag):
|
||||
bin = ""
|
||||
if type(flag) == types.StringType:
|
||||
if type(flag) == StringType:
|
||||
flag = ord(flag)
|
||||
while flag:
|
||||
if flag & 0x01:
|
||||
|
@ -2,6 +2,7 @@ import DefaultTable
|
||||
import struct
|
||||
from fontTools.ttLib import sfnt
|
||||
from fontTools.misc.textTools import safeEval, readHex
|
||||
from types import TupleType
|
||||
|
||||
|
||||
class table__k_e_r_n(DefaultTable.DefaultTable):
|
||||
@ -125,7 +126,7 @@ class KernTable_format_0:
|
||||
if not hasattr(self, "kernTable"):
|
||||
self.kernTable = {}
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
self.kernTable[(attrs["l"], attrs["r"])] = safeEval(attrs["v"])
|
||||
|
@ -4,6 +4,7 @@ import struct, sstruct
|
||||
import array
|
||||
from fontTools import ttLib
|
||||
from fontTools.misc.textTools import safeEval, readHex
|
||||
from types import TupleType
|
||||
|
||||
|
||||
postFormat = """
|
||||
@ -192,7 +193,7 @@ class table__p_o_s_t(DefaultTable.DefaultTable):
|
||||
elif name == "psNames":
|
||||
self.mapping = {}
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name == "psName":
|
||||
@ -200,7 +201,7 @@ class table__p_o_s_t(DefaultTable.DefaultTable):
|
||||
elif name == "extraNames":
|
||||
self.extraNames = []
|
||||
for element in content:
|
||||
if type(element) <> type(()):
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
name, attrs, content = element
|
||||
if name == "psName":
|
||||
|
Loading…
x
Reference in New Issue
Block a user