From 45c266441eab41daf5a31ce9571d5b59dba6e05a Mon Sep 17 00:00:00 2001 From: Sascha Brawer Date: Fri, 17 Feb 2017 13:49:32 +0100 Subject: [PATCH] [feaLib] Add tests for zero values in contextual positioning Specifically, contextual positioning statements with in-line single positioning rules, in horizontal and in vertical contexts. For these test cases, feaLib and makeotf produce the exact same output. https://github.com/fonttools/fonttools/issues/633 --- Tests/feaLib/builder_test.py | 1 + .../ZeroValue_ChainSinglePos_horizontal.fea | 9 ++ .../ZeroValue_ChainSinglePos_horizontal.ttx | 89 +++++++++++++++++++ .../ZeroValue_ChainSinglePos_vertical.fea | 9 ++ .../ZeroValue_ChainSinglePos_vertical.ttx | 89 +++++++++++++++++++ 5 files changed, 197 insertions(+) create mode 100644 Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.fea create mode 100644 Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.ttx create mode 100644 Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.fea create mode 100644 Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.ttx diff --git a/Tests/feaLib/builder_test.py b/Tests/feaLib/builder_test.py index bb4015b10..0b6bebe30 100644 --- a/Tests/feaLib/builder_test.py +++ b/Tests/feaLib/builder_test.py @@ -67,6 +67,7 @@ class BuilderTest(unittest.TestCase): name size size2 multiple_feature_blocks omitted_GlyphClassDef ZeroValue_SinglePos ZeroValue_PairPos_horizontal ZeroValue_PairPos_vertical + ZeroValue_ChainSinglePos_horizontal ZeroValue_ChainSinglePos_vertical """.split() def __init__(self, methodName): diff --git a/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.fea b/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.fea new file mode 100644 index 000000000..480fc76d0 --- /dev/null +++ b/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.fea @@ -0,0 +1,9 @@ +# For contextual positioning statements with in-line single positioning rules, +# zeroes should get compiled to ValueRecord format 0. +# https://github.com/fonttools/fonttools/issues/633 + +# Zero value in a horizontal context. +feature kern { + pos A G' 0 A; # value format A + pos B G' <0 0 0 0> B; # value format B +} kern; diff --git a/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.ttx b/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.ttx new file mode 100644 index 000000000..ce76370e1 --- /dev/null +++ b/Tests/feaLib/data/ZeroValue_ChainSinglePos_horizontal.ttx @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.fea b/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.fea new file mode 100644 index 000000000..a9fb7d1df --- /dev/null +++ b/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.fea @@ -0,0 +1,9 @@ +# For contextual positioning statements with in-line single positioning rules, +# zeroes should get compiled to ValueRecord format 0. +# https://github.com/fonttools/fonttools/issues/633 + +# Zero value in a vertical context. +feature vkrn { + pos A G' 0 A; # value format A + pos B G' <0 0 0 0> B; # value format B +} vkrn; diff --git a/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.ttx b/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.ttx new file mode 100644 index 000000000..e1cb5d613 --- /dev/null +++ b/Tests/feaLib/data/ZeroValue_ChainSinglePos_vertical.ttx @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +