From e7fb216ad8f65ee4d451a0c3e698dfafd7cf2436 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 May 2014 19:08:39 -0400 Subject: Fix cmap subtable format 4 compiling Was failing all these years, if a idDelta value happened to be exactly -0x8000... Test case: roundtripping MTLmr3m.ttf. --- Lib/fontTools/ttLib/tables/_c_m_a_p.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py index 3398a889..9dea0108 100644 --- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py +++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py @@ -712,7 +712,7 @@ class cmap_format_4(CmapSubtable): if idDelta > 0x7FFF: idDelta = idDelta - 0x10000 - elif idDelta < -0x7FFF: + elif idDelta < -0x8000: idDelta = idDelta + 0x10000 return idDelta -- cgit v1.2.3