aboutsummaryrefslogtreecommitdiff
path: root/Lib/fontTools/ttLib/tables/_n_a_m_e.py
diff options
context:
space:
mode:
authorJust <Just@4cde692c-a291-49d1-8350-778aa11640f8>2000-10-23 14:36:20 +0000
committerJust <Just@4cde692c-a291-49d1-8350-778aa11640f8>2000-10-23 14:36:20 +0000
commit6d925f5b9a6e1b58765ee09fe8552b75f75241c3 (patch)
tree7453e8a80dae14a956dfeb8b123a7c2e9e942f87 /Lib/fontTools/ttLib/tables/_n_a_m_e.py
parentfc99ad1513ca5443a29f1cc99df6016325e8dcbb (diff)
downloadfonttools-6d925f5b9a6e1b58765ee09fe8552b75f75241c3.tar.gz
workaround for odd-length unicode strings (!)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@126 4cde692c-a291-49d1-8350-778aa11640f8
Diffstat (limited to 'Lib/fontTools/ttLib/tables/_n_a_m_e.py')
-rw-r--r--Lib/fontTools/ttLib/tables/_n_a_m_e.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/fontTools/ttLib/tables/_n_a_m_e.py b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
index 62bd1460..8bcf69cf 100644
--- a/Lib/fontTools/ttLib/tables/_n_a_m_e.py
+++ b/Lib/fontTools/ttLib/tables/_n_a_m_e.py
@@ -89,7 +89,12 @@ class NameRecord:
])
writer.newline()
if self.platformID == 0 or (self.platformID == 3 and self.platEncID in (0, 1)):
- writer.write16bit(self.string)
+ if len(self.string) % 2:
+ # no, shouldn't happen, but some of the Apple
+ # tools cause this anyway :-(
+ writer.write16bit(self.string + "\0")
+ else:
+ writer.write16bit(self.string)
else:
writer.write8bit(self.string)
writer.newline()