From 9f7a4ea3e7f0d6ddd3c102d36806d347606a1270 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 9 Aug 2021 11:27:46 +0200 Subject: [PATCH 1/2] otTables: fix CompositeMode enum missing PLUS mode Our enumeration of CompositeMode was missing one COMPOSITE_PLUS mode (12)... see 'PaintComposite' paragraph in https://github.com/googlefonts/colr-gradients-spec/blob/main/OFF_AMD2_WD.md --- Lib/fontTools/ttLib/tables/otTables.py | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index ff32e2dd4..c83a7610a 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -1480,21 +1480,22 @@ class CompositeMode(IntEnum): SRC_ATOP = 9 DEST_ATOP = 10 XOR = 11 - SCREEN = 12 - OVERLAY = 13 - DARKEN = 14 - LIGHTEN = 15 - COLOR_DODGE = 16 - COLOR_BURN = 17 - HARD_LIGHT = 18 - SOFT_LIGHT = 19 - DIFFERENCE = 20 - EXCLUSION = 21 - MULTIPLY = 22 - HSL_HUE = 23 - HSL_SATURATION = 24 - HSL_COLOR = 25 - HSL_LUMINOSITY = 26 + PLUS = 12 + SCREEN = 13 + OVERLAY = 14 + DARKEN = 15 + LIGHTEN = 16 + COLOR_DODGE = 17 + COLOR_BURN = 18 + HARD_LIGHT = 19 + SOFT_LIGHT = 20 + DIFFERENCE = 21 + EXCLUSION = 22 + MULTIPLY = 23 + HSL_HUE = 24 + HSL_SATURATION = 25 + HSL_COLOR = 26 + HSL_LUMINOSITY = 27 class PaintFormat(IntEnum): From d025bb8ba7741216aa0b3b7e1f3d0c0fcb256422 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 9 Aug 2021 11:30:00 +0200 Subject: [PATCH 2/2] fix NameError while decompiling ClipList when range references a missing glyph ID, the loop must continue --- Lib/fontTools/ttLib/tables/otTables.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index c83a7610a..679df751e 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -1333,6 +1333,7 @@ class ClipList(getFormatSwitchingBaseTableClass("uint8")): glyph = glyphOrder[glyphID] except IndexError: missingGlyphs.append(glyphID) + continue if glyph not in clips: clips[glyph] = copy.copy(rec.ClipBox) else: