aboutsummaryrefslogtreecommitdiff
path: root/Lib/fontTools/ttLib/tables/_n_a_m_e.py
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-10-28 12:16:41 +0100
committerBehdad Esfahbod <behdad@behdad.org>2013-10-28 12:16:41 +0100
commit94118dcea43bbc618b35774d9c9913738fa5e97a (patch)
tree3a9ebf271d389733a5bb5348631171a6f874fec5 /Lib/fontTools/ttLib/tables/_n_a_m_e.py
parent0ba7aa7ab5153e6a490425dd0f859cc5947360f4 (diff)
downloadfonttools-94118dcea43bbc618b35774d9c9913738fa5e97a.tar.gz
Fix cmap subtable sort order
https://github.com/behdad/fonttools/issues/22
Diffstat (limited to 'Lib/fontTools/ttLib/tables/_n_a_m_e.py')
-rw-r--r--Lib/fontTools/ttLib/tables/_n_a_m_e.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/Lib/fontTools/ttLib/tables/_n_a_m_e.py b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
index 22709839..5234ae1e 100644
--- a/Lib/fontTools/ttLib/tables/_n_a_m_e.py
+++ b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
@@ -139,18 +139,21 @@ class NameRecord:
according to the spec by just sorting it..."""
if type(self) != type(other): return cmp(type(self), type(other))
- if self.__class__ != other.__class__: return cmp(self.__class__, other.__class__)
- selftuple = (self.platformID,
- self.platEncID,
- self.langID,
- self.nameID,
- self.string)
- othertuple = (other.platformID,
- other.platEncID,
- other.langID,
- other.nameID,
- other.string)
+ selftuple = (
+ getattr(self, "platformID", None),
+ getattr(self, "platEncID", None),
+ getattr(self, "langID", None),
+ getattr(self, "nameID", None),
+ getattr(self, "string", None),
+ )
+ othertuple = (
+ getattr(other, "platformID", None),
+ getattr(other, "platEncID", None),
+ getattr(other, "langID", None),
+ getattr(other, "nameID", None),
+ getattr(other, "string", None),
+ )
return cmp(selftuple, othertuple)
def __repr__(self):