[feaLib] Use specification example for table GDEF as unit test
This commit is contained in:
parent
79eb7d11f7
commit
03796cf3a4
@ -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 "
|
"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 "
|
"ydieresis yacute "
|
||||||
"grave acute dieresis macron circumflex cedilla umlaut ogonek caron "
|
"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()
|
).split()
|
||||||
font = TTFont()
|
font = TTFont()
|
||||||
font.setGlyphOrder(glyphs)
|
font.setGlyphOrder(glyphs)
|
||||||
@ -167,7 +167,7 @@ class BuilderTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_spec(self):
|
def test_spec(self):
|
||||||
for name in ("4h1 5d1 5d2 5fi1 5fi2 5fi3 5fi4 5h1 "
|
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()
|
font = makeTTFont()
|
||||||
addOpenTypeFeatures(self.getpath("spec%s.fea" % name), font)
|
addOpenTypeFeatures(self.getpath("spec%s.fea" % name), font)
|
||||||
self.expect_ttx(font, self.getpath("spec%s.ttx" % name))
|
self.expect_ttx(font, self.getpath("spec%s.ttx" % name))
|
||||||
|
13
Lib/fontTools/feaLib/testdata/spec9b.fea
vendored
Normal file
13
Lib/fontTools/feaLib/testdata/spec9b.fea
vendored
Normal file
@ -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;
|
75
Lib/fontTools/feaLib/testdata/spec9b.ttx
vendored
Normal file
75
Lib/fontTools/feaLib/testdata/spec9b.ttx
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ttFont sfntVersion="true" ttLibVersion="3.0">
|
||||||
|
|
||||||
|
<GDEF>
|
||||||
|
<Version value="1.0"/>
|
||||||
|
<GlyphClassDef>
|
||||||
|
<ClassDef glyph="acute" class="3"/>
|
||||||
|
<ClassDef glyph="c_s" class="2"/>
|
||||||
|
<ClassDef glyph="c_t" class="2"/>
|
||||||
|
<ClassDef glyph="f" class="1"/>
|
||||||
|
<ClassDef glyph="f_f_i" class="2"/>
|
||||||
|
<ClassDef glyph="f_i" class="2"/>
|
||||||
|
<ClassDef glyph="grave" class="3"/>
|
||||||
|
<ClassDef glyph="i" class="1"/>
|
||||||
|
<ClassDef glyph="noon.final" class="4"/>
|
||||||
|
<ClassDef glyph="noon.initial" class="4"/>
|
||||||
|
<ClassDef glyph="s_t" class="2"/>
|
||||||
|
</GlyphClassDef>
|
||||||
|
<AttachList>
|
||||||
|
<Coverage>
|
||||||
|
<Glyph value="noon.final"/>
|
||||||
|
<Glyph value="noon.initial"/>
|
||||||
|
</Coverage>
|
||||||
|
<!-- GlyphCount=2 -->
|
||||||
|
<AttachPoint index="0">
|
||||||
|
<!-- PointCount=1 -->
|
||||||
|
<PointIndex index="0" value="5"/>
|
||||||
|
</AttachPoint>
|
||||||
|
<AttachPoint index="1">
|
||||||
|
<!-- PointCount=1 -->
|
||||||
|
<PointIndex index="0" value="4"/>
|
||||||
|
</AttachPoint>
|
||||||
|
</AttachList>
|
||||||
|
<LigCaretList>
|
||||||
|
<Coverage>
|
||||||
|
<Glyph value="c_t"/>
|
||||||
|
<Glyph value="f_f_i"/>
|
||||||
|
<Glyph value="f_i"/>
|
||||||
|
<Glyph value="s_t"/>
|
||||||
|
</Coverage>
|
||||||
|
<!-- LigGlyphCount=4 -->
|
||||||
|
<LigGlyph index="0">
|
||||||
|
<!-- CaretCount=1 -->
|
||||||
|
<CaretValue index="0" Format="1">
|
||||||
|
<Coordinate value="500"/>
|
||||||
|
</CaretValue>
|
||||||
|
</LigGlyph>
|
||||||
|
<LigGlyph index="1">
|
||||||
|
<!-- CaretCount=2 -->
|
||||||
|
<CaretValue index="0" Format="2">
|
||||||
|
<CaretValuePoint value="23"/>
|
||||||
|
</CaretValue>
|
||||||
|
<CaretValue index="1" Format="2">
|
||||||
|
<CaretValuePoint value="46"/>
|
||||||
|
</CaretValue>
|
||||||
|
</LigGlyph>
|
||||||
|
<LigGlyph index="2">
|
||||||
|
<!-- CaretCount=2 -->
|
||||||
|
<CaretValue index="0" Format="1">
|
||||||
|
<Coordinate value="380"/>
|
||||||
|
</CaretValue>
|
||||||
|
<CaretValue index="1" Format="1">
|
||||||
|
<Coordinate value="400"/>
|
||||||
|
</CaretValue>
|
||||||
|
</LigGlyph>
|
||||||
|
<LigGlyph index="3">
|
||||||
|
<!-- CaretCount=1 -->
|
||||||
|
<CaretValue index="0" Format="1">
|
||||||
|
<Coordinate value="500"/>
|
||||||
|
</CaretValue>
|
||||||
|
</LigGlyph>
|
||||||
|
</LigCaretList>
|
||||||
|
</GDEF>
|
||||||
|
|
||||||
|
</ttFont>
|
Loading…
x
Reference in New Issue
Block a user