[feaLib] Do not emit empty GSUB and GPOS tables
The AFDKO `makeotf` tool does not emit empty tables, either.
This commit is contained in:
parent
3433f363e7
commit
bdc72e1198
@ -32,8 +32,14 @@ class Builder(object):
|
||||
parsetree = Parser(self.featurefile_path).parse()
|
||||
parsetree.build(self)
|
||||
for tag in ('GPOS', 'GSUB'):
|
||||
fontTable = self.font[tag] = getTableClass(tag)()
|
||||
fontTable.table = self.makeTable(tag)
|
||||
table = self.makeTable(tag)
|
||||
if (table.ScriptList.ScriptCount > 0 or
|
||||
table.FeatureList.FeatureCount > 0 or
|
||||
table.LookupList.LookupCount > 0):
|
||||
fontTable = self.font[tag] = getTableClass(tag)()
|
||||
fontTable.table = table
|
||||
elif self.font.has_key(tag):
|
||||
del self.font[tag]
|
||||
|
||||
def get_lookup_(self, location, builder_class):
|
||||
if (self.cur_lookup_ and
|
||||
|
13
Lib/fontTools/feaLib/testdata/GPOS_1.ttx
vendored
13
Lib/fontTools/feaLib/testdata/GPOS_1.ttx
vendored
@ -1,19 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<GSUB>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
|
13
Lib/fontTools/feaLib/testdata/GPOS_2.ttx
vendored
13
Lib/fontTools/feaLib/testdata/GPOS_2.ttx
vendored
@ -1,19 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<GSUB>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
|
13
Lib/fontTools/feaLib/testdata/GSUB_2.ttx
vendored
13
Lib/fontTools/feaLib/testdata/GSUB_2.ttx
vendored
@ -50,17 +50,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/GSUB_3.ttx
vendored
13
Lib/fontTools/feaLib/testdata/GSUB_3.ttx
vendored
@ -59,17 +59,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/GSUB_8.ttx
vendored
13
Lib/fontTools/feaLib/testdata/GSUB_8.ttx
vendored
@ -126,17 +126,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
@ -136,17 +136,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/lookup.ttx
vendored
13
Lib/fontTools/feaLib/testdata/lookup.ttx
vendored
@ -59,17 +59,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/spec4h1.ttx
vendored
13
Lib/fontTools/feaLib/testdata/spec4h1.ttx
vendored
@ -151,17 +151,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/spec5d1.ttx
vendored
13
Lib/fontTools/feaLib/testdata/spec5d1.ttx
vendored
@ -59,17 +59,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/spec5d2.ttx
vendored
13
Lib/fontTools/feaLib/testdata/spec5d2.ttx
vendored
@ -55,17 +55,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/spec5fi1.ttx
vendored
13
Lib/fontTools/feaLib/testdata/spec5fi1.ttx
vendored
@ -119,17 +119,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
13
Lib/fontTools/feaLib/testdata/spec5h1.ttx
vendored
13
Lib/fontTools/feaLib/testdata/spec5h1.ttx
vendored
@ -51,17 +51,4 @@
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<GPOS>
|
||||
<Version value="1.0"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=0 -->
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=0 -->
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=0 -->
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
</ttFont>
|
||||
|
Loading…
x
Reference in New Issue
Block a user