[feaLib] Test compiling zero values for SinglePos in vertical context

https://github.com/fonttools/fonttools/issues/633
This commit is contained in:
Sascha Brawer 2017-02-17 14:19:54 +01:00
parent 45c266441e
commit dc7bf89648
5 changed files with 61 additions and 4 deletions

View File

@ -65,7 +65,7 @@ class BuilderTest(unittest.TestCase):
bug453 bug457 bug463 bug501 bug502 bug504 bug505 bug506 bug509
bug512 bug514 bug568 bug633
name size size2 multiple_feature_blocks omitted_GlyphClassDef
ZeroValue_SinglePos
ZeroValue_SinglePos_horizontal ZeroValue_SinglePos_vertical
ZeroValue_PairPos_horizontal ZeroValue_PairPos_vertical
ZeroValue_ChainSinglePos_horizontal ZeroValue_ChainSinglePos_vertical
""".split()

View File

@ -0,0 +1,8 @@
# For SinglePos statements, 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 0; # format A
pos B <0 0 0 0>; # format B
} kern;

View File

@ -20,7 +20,7 @@
<FeatureList>
<!-- FeatureCount=1 -->
<FeatureRecord index="0">
<FeatureTag value="TEST"/>
<FeatureTag value="kern"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>

View File

@ -1,6 +1,8 @@
# For SinglePos statements, zeroes should get compiled to ValueRecord format 0.
# https://github.com/fonttools/fonttools/issues/633
feature TEST {
# Zero value in a vertical context.
feature vkrn {
pos A 0; # format A
pos B <0 0 0 0>; # format B
} TEST;
} vkrn;

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="true" ttLibVersion="3.0">
<GPOS>
<Version value="0x00010000"/>
<ScriptList>
<!-- ScriptCount=1 -->
<ScriptRecord index="0">
<ScriptTag value="DFLT"/>
<Script>
<DefaultLangSys>
<ReqFeatureIndex value="65535"/>
<!-- FeatureCount=1 -->
<FeatureIndex index="0" value="0"/>
</DefaultLangSys>
<!-- LangSysCount=0 -->
</Script>
</ScriptRecord>
</ScriptList>
<FeatureList>
<!-- FeatureCount=1 -->
<FeatureRecord index="0">
<FeatureTag value="vkrn"/>
<Feature>
<!-- LookupCount=1 -->
<LookupListIndex index="0" value="0"/>
</Feature>
</FeatureRecord>
</FeatureList>
<LookupList>
<!-- LookupCount=1 -->
<Lookup index="0">
<LookupType value="1"/>
<LookupFlag value="0"/>
<!-- SubTableCount=1 -->
<SinglePos index="0" Format="1">
<Coverage>
<Glyph value="A"/>
<Glyph value="B"/>
</Coverage>
<ValueFormat value="0"/>
</SinglePos>
</Lookup>
</LookupList>
</GPOS>
</ttFont>