[feaLib] Compile test files to binary tables in addition to XML

https://github.com/behdad/fonttools/issues/463
This commit is contained in:
Sascha Brawer 2016-01-26 12:39:41 +01:00
parent b2e663a1fc
commit 6dcddd9e36
5 changed files with 17 additions and 12 deletions

View File

@ -21,7 +21,8 @@ def makeTTFont():
"zero one two three four five six seven eight nine "
"zero.oldstyle one.oldstyle two.oldstyle three.oldstyle "
"four.oldstyle five.oldstyle six.oldstyle seven.oldstyle "
"eight.oldstyle nine.oldstyle onehalf "
"eight.oldstyle nine.oldstyle onequarter onehalf threequarters "
"onesuperior twosuperior threesuperior ordfeminine ordmasculine "
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
"a b c d e f g h i j k l m n o p q r s t u v w x y z "
"A.sc B.sc C.sc D.sc E.sc F.sc G.sc H.sc I.sc J.sc K.sc L.sc M.sc "
@ -30,7 +31,7 @@ def makeTTFont():
"a.alt1 a.alt2 a.alt3 b.alt c.mid d.alt d.mid e.begin e.mid "
"n.end s.end "
"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 breve "
"grave acute dieresis macron circumflex cedilla umlaut ogonek caron "
"damma hamza sukun kasratan lam_meem_jeem noon.final noon.initial "
).split()
@ -114,6 +115,10 @@ class BuilderTest(unittest.TestCase):
font = makeTTFont()
addOpenTypeFeatures(self.getpath("%s.fea" % name), font)
self.expect_ttx(font, self.getpath("%s.ttx" % name))
# Make sure we can produce binary OpenType tables, not just XML.
for tag in ('GDEF', 'GSUB', 'GPOS'):
if tag in font:
font[tag].compile(font)
def test_alternateSubst_multipleSubstitutionsForSameGlyph(self):
self.assertRaisesRegex(

View File

@ -26,6 +26,6 @@ feature ordn {
} ordn;
feature liga {
sub f i by fi;
sub f l by fl;
sub f i by f_i;
sub f l by f_l;
} liga;

View File

@ -180,8 +180,8 @@
<!-- SubTableCount=1 -->
<LigatureSubst index="0">
<LigatureSet glyph="f">
<Ligature components="i" glyph="fi"/>
<Ligature components="l" glyph="fl"/>
<Ligature components="i" glyph="f_i"/>
<Ligature components="l" glyph="f_l"/>
</LigatureSet>
</LigatureSubst>
</Lookup>

View File

@ -5,15 +5,15 @@ languagesystem latn ITA;
feature hlig {
script latn;
language DEU exclude_dflt required;
sub D E U by D_E_U;
sub D E U by D.sc;
language FRA exclude_dflt;
sub F R A by F_R_A;
sub F R A by F.sc;
} hlig;
feature liga {
language ITA exclude_dflt required;
sub I T A by I_T_A;
sub I T A by I.sc;
} liga;
feature scmp {

View File

@ -76,7 +76,7 @@
<!-- SubTableCount=1 -->
<LigatureSubst index="0">
<LigatureSet glyph="D">
<Ligature components="E,U" glyph="D_E_U"/>
<Ligature components="E,U" glyph="D.sc"/>
</LigatureSet>
</LigatureSubst>
</Lookup>
@ -86,7 +86,7 @@
<!-- SubTableCount=1 -->
<LigatureSubst index="0">
<LigatureSet glyph="F">
<Ligature components="R,A" glyph="F_R_A"/>
<Ligature components="R,A" glyph="F.sc"/>
</LigatureSet>
</LigatureSubst>
</Lookup>
@ -96,7 +96,7 @@
<!-- SubTableCount=1 -->
<LigatureSubst index="0">
<LigatureSet glyph="I">
<Ligature components="T,A" glyph="I_T_A"/>
<Ligature components="T,A" glyph="I.sc"/>
</LigatureSet>
</LigatureSubst>
</Lookup>