diff --git a/Lib/fontTools/cffLib.py b/Lib/fontTools/cffLib.py index b724c62d7..c859265ae 100644 --- a/Lib/fontTools/cffLib.py +++ b/Lib/fontTools/cffLib.py @@ -1086,7 +1086,7 @@ class NumberConverter(SimpleConverter): class ArrayConverter(SimpleConverter): def xmlWrite(self, xmlWriter, name, value, progress): - if isinstance(value[0], list): + if value and isinstance(value[0], list): xmlWriter.begintag(name) xmlWriter.newline() xmlWriter.indent() @@ -1907,6 +1907,8 @@ class DictCompiler(object): data.append(self.arg_number(num)) return bytesjoin(data) def arg_delta(self, value): + if not value: + return b"" val0 = value[0] if isinstance(val0, list): data = self.arg_delta_blend(value) diff --git a/Lib/fontTools/misc/psCharStrings.py b/Lib/fontTools/misc/psCharStrings.py index 3976cbe8b..fc9ff5da1 100644 --- a/Lib/fontTools/misc/psCharStrings.py +++ b/Lib/fontTools/misc/psCharStrings.py @@ -1319,7 +1319,8 @@ class DictDecompiler(ByteCodeBase): def arg_delta(self, name): valueList = self.popall() out = [] - if isinstance(valueList[0], list): # arg_blendList() has already converted these to absolute values. + if valueList and isinstance(valueList[0], list): + # arg_blendList() has already converted these to absolute values. out = valueList else: current = 0