From d3a6a4e9e4a8a9f9e083abcac43405237863bb0c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 Mar 2018 12:53:21 -0700 Subject: [PATCH] Don't fail during ValueRecord copy if src has more items We drop hinting by simply changing ValueFormat, without cleaning up the actual ValueRecords. This was causing failure at this assert if font was subsetted without hinting and then passed to mutator. --- Lib/fontTools/ttLib/tables/otBase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py index 18954e1c9..197c13812 100644 --- a/Lib/fontTools/ttLib/tables/otBase.py +++ b/Lib/fontTools/ttLib/tables/otBase.py @@ -894,7 +894,8 @@ class ValueRecord(object): setattr(self, name, None if isDevice else 0) if src is not None: for key,val in src.__dict__.items(): - assert hasattr(self, key) + if not hasattr(self, key): + continue setattr(self, key, val) elif src is not None: self.__dict__ = src.__dict__.copy()