diff --git a/tests/featureWriters/variableFeatureWriter_test.py b/tests/featureWriters/variableFeatureWriter_test.py index 5ce55779..077fd4f3 100644 --- a/tests/featureWriters/variableFeatureWriter_test.py +++ b/tests/featureWriters/variableFeatureWriter_test.py @@ -59,3 +59,76 @@ def test_variable_features(FontClass): } curs; """ # noqa: B950 ) + + +def test_variable_features_old_kern_writer(FontClass): + tmp = io.StringIO() + designspace = designspaceLib.DesignSpaceDocument.fromfile( + "tests/data/TestVarfea.designspace" + ) + designspace.loadSourceFonts(FontClass) + + default_source = designspace.findDefault() + assert default_source is not None + default_ufo = default_source.font + assert default_ufo is not None + default_ufo.lib["com.github.googlei18n.ufo2ft.featureWriters"] = [ + { + "module": "ufo2ft.featureWriters.kernFeatureWriter2", + "class": "KernFeatureWriter", + }, + { + "module": "ufo2ft.featureWriters.markFeatureWriter", + "class": "MarkFeatureWriter", + }, + { + "module": "ufo2ft.featureWriters.gdefFeatureWriter", + "class": "GdefFeatureWriter", + }, + { + "module": "ufo2ft.featureWriters.cursFeatureWriter", + "class": "CursFeatureWriter", + }, + ] + + _ = compileVariableTTF(designspace, debugFeatureFile=tmp) + + assert dedent("\n" + tmp.getvalue()) == dedent( + """ + markClass dotabove-ar @MC_top; + markClass gravecmb @MC_top; + + lookup kern_rtl { + lookupflag IgnoreMarks; + pos alef-ar.fina alef-ar.fina <(wght=100:15 wght=1000:35) 0 (wght=100:15 wght=1000:35) 0>; + } kern_rtl; + + feature kern { + lookup kern_rtl; + } kern; + + feature mark { + lookup mark2base { + pos base alef-ar.fina + mark @MC_top; + pos base a + mark @MC_top; + } mark2base; + + } mark; + + table GDEF { + LigatureCaretByPos peh-ar.init 100; + } GDEF; + + feature curs { + lookup curs_rtl { + lookupflag RightToLeft IgnoreMarks; + pos cursive alef-ar.fina ; + pos cursive peh-ar.init ; + pos cursive peh-ar.init.BRACKET.varAlt01 ; + } curs_rtl; + + } curs; +""" # noqa: B950 + )