From 03796cf3a459a81826c1d247f4847850208212cd Mon Sep 17 00:00:00 2001 From: Sascha Brawer Date: Mon, 11 Jan 2016 07:17:29 +0100 Subject: [PATCH] [feaLib] Use specification example for table GDEF as unit test --- Lib/fontTools/feaLib/builder_test.py | 4 +- Lib/fontTools/feaLib/testdata/spec9b.fea | 13 ++++ Lib/fontTools/feaLib/testdata/spec9b.ttx | 75 ++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Lib/fontTools/feaLib/testdata/spec9b.fea create mode 100644 Lib/fontTools/feaLib/testdata/spec9b.ttx diff --git a/Lib/fontTools/feaLib/builder_test.py b/Lib/fontTools/feaLib/builder_test.py index 32161df66..03de9498f 100644 --- a/Lib/fontTools/feaLib/builder_test.py +++ b/Lib/fontTools/feaLib/builder_test.py @@ -30,7 +30,7 @@ def makeTTFont(): "f_l c_h c_k c_s c_t f_f f_f_i f_f_l f_i o_f_f_i s_t " "ydieresis yacute " "grave acute dieresis macron circumflex cedilla umlaut ogonek caron " - "damma hamza sukun kasratan lam_meem_jeem " + "damma hamza sukun kasratan lam_meem_jeem noon.final noon.initial " ).split() font = TTFont() font.setGlyphOrder(glyphs) @@ -167,7 +167,7 @@ class BuilderTest(unittest.TestCase): def test_spec(self): for name in ("4h1 5d1 5d2 5fi1 5fi2 5fi3 5fi4 5h1 " - "6d2 6e 6f 6h_ii").split(): + "6d2 6e 6f 6h_ii 9b").split(): font = makeTTFont() addOpenTypeFeatures(self.getpath("spec%s.fea" % name), font) self.expect_ttx(font, self.getpath("spec%s.ttx" % name)) diff --git a/Lib/fontTools/feaLib/testdata/spec9b.fea b/Lib/fontTools/feaLib/testdata/spec9b.fea new file mode 100644 index 000000000..f171d218b --- /dev/null +++ b/Lib/fontTools/feaLib/testdata/spec9b.fea @@ -0,0 +1,13 @@ +@BASE = [f i]; +@LIGATURES = [c_s c_t f_i f_f_i s_t]; +@MARKS = [acute grave]; +@COMPONENT = [noon.final noon.initial]; + +table GDEF { + GlyphClassDef @BASE, @LIGATURES, @MARKS, @COMPONENT; + Attach noon.final 5; + Attach noon.initial 4; + LigatureCaretByPos f_i 400 380; + LigatureCaretByPos [c_t s_t] 500; + LigatureCaretByIndex f_f_i 23 46; +} GDEF; diff --git a/Lib/fontTools/feaLib/testdata/spec9b.ttx b/Lib/fontTools/feaLib/testdata/spec9b.ttx new file mode 100644 index 000000000..e09daf850 --- /dev/null +++ b/Lib/fontTools/feaLib/testdata/spec9b.ttx @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +