There was an error while loading. Please reload this page.
1 parent b81313f commit a1826bbCopy full SHA for a1826bb
1 file changed
lib/matplotlib/type1font.py
@@ -128,13 +128,16 @@ def _split(self, data):
128
zeros -= 1
129
idx -= 1
130
if zeros:
131
- raise RuntimeError('Insufficiently many zeros in Type 1 font')
+ # this may have been a problem on old implementations that
132
+ # used the zeros as necessary padding
133
+ logging.info('Insufficiently many zeros in Type 1 font')
134
135
# Convert encrypted part to binary (if we read a pfb file, we may end
136
# up converting binary to hexadecimal to binary again; but if we read
137
# a pfa file, this part is already in hex, and I am not quite sure if
138
# even the pfb format guarantees that it will be in binary).
- binary = binascii.unhexlify(data[len1:idx+1])
139
+ idx1 = len1 + ((idx - len1 + 2) & ~1) # ensure an even number of bytes
140
+ binary = binascii.unhexlify(data[len1:idx1])
141
142
return data[:len1], binary, data[idx+1:]
143
0 commit comments