diff --git a/Lib/fontTools/otlLib/maxContextCalc.py b/Lib/fontTools/otlLib/maxContextCalc.py index 03e7561b6..eee8d48f3 100644 --- a/Lib/fontTools/otlLib/maxContextCalc.py +++ b/Lib/fontTools/otlLib/maxContextCalc.py @@ -92,5 +92,5 @@ def maxCtxContextualRule(maxCtx, st, chain): if not chain: return max(maxCtx, st.GlyphCount) elif chain == "Reverse": - return max(maxCtx, st.GlyphCount + st.LookAheadGlyphCount) + return max(maxCtx, 1 + st.LookAheadGlyphCount) return max(maxCtx, st.InputGlyphCount + st.LookAheadGlyphCount) diff --git a/Tests/otlLib/maxContextCalc_test.py b/Tests/otlLib/maxContextCalc_test.py index f672052ee..a94ba246e 100644 --- a/Tests/otlLib/maxContextCalc_test.py +++ b/Tests/otlLib/maxContextCalc_test.py @@ -39,8 +39,8 @@ def test_max_ctx_calc_features(): rsub a' by b; rsub a b' by c; rsub a b' c by A; + rsub [a b] [a b c]' [a b] by B; rsub [a b] c' by A; - rsub [a b] c' [a b] by B; lookup GSUB_EXT; } sub1;