From 0c92d33bc0bb07904c1210f321ba4c3e030e7846 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 19 Feb 2021 11:02:26 +0000 Subject: [PATCH] fix sub-string check in update uniqueID --- Lib/fontTools/varLib/instancer/names.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/varLib/instancer/names.py b/Lib/fontTools/varLib/instancer/names.py index 42f9ed4c7..96898eb0b 100644 --- a/Lib/fontTools/varLib/instancer/names.py +++ b/Lib/fontTools/varLib/instancer/names.py @@ -352,10 +352,11 @@ def _updateUniqueIdNameRecord(varfont, nameIDs, platform): nameRecord = nametable.getName(nameID, *platform) if not nameRecord: continue - if currentRecord.toUnicode() in nameRecord.toUnicode(): + if nameRecord.toUnicode() in currentRecord.toUnicode(): return currentRecord.toUnicode().replace( nameRecord.toUnicode(), nameIDs[nameRecord.nameID] ) + # Create a new string since we couldn't find any substrings. fontVersion = _fontVersion(varfont, platform) achVendID = varfont["OS/2"].achVendID