diff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py
index 4e7c27e68..745374bab 100644
--- a/Lib/fontTools/feaLib/builder.py
+++ b/Lib/fontTools/feaLib/builder.py
@@ -2,6 +2,7 @@ from __future__ import print_function, division, absolute_import
from __future__ import unicode_literals
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.parser import Parser
+from fontTools.ttLib import getTableClass
from fontTools.ttLib.tables import otTables
import warnings
@@ -30,8 +31,9 @@ class Builder(object):
def build(self):
parsetree = Parser(self.featurefile_path).parse()
parsetree.build(self)
- self.gpos = self.font['GPOS'] = self.makeTable('GPOS')
- self.gsub = self.font['GSUB'] = self.makeTable('GSUB')
+ for tag in ('GPOS', 'GSUB'):
+ fontTable = self.font[tag] = getTableClass(tag)()
+ fontTable.table = self.makeTable(tag)
def get_lookup_(self, location, builder_class):
if (self.cur_lookup_ and
diff --git a/Lib/fontTools/feaLib/testdata/GSUB_3.ttx b/Lib/fontTools/feaLib/testdata/GSUB_3.ttx
index 905d920f3..6e09715cb 100644
--- a/Lib/fontTools/feaLib/testdata/GSUB_3.ttx
+++ b/Lib/fontTools/feaLib/testdata/GSUB_3.ttx
@@ -2,73 +2,69 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Lib/fontTools/feaLib/testdata/language_required.ttx b/Lib/fontTools/feaLib/testdata/language_required.ttx
index d3447e222..8a366fc8f 100644
--- a/Lib/fontTools/feaLib/testdata/language_required.ttx
+++ b/Lib/fontTools/feaLib/testdata/language_required.ttx
@@ -2,135 +2,131 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Lib/fontTools/feaLib/testdata/spec4h1.ttx b/Lib/fontTools/feaLib/testdata/spec4h1.ttx
index cf16b833a..f3d97e80e 100644
--- a/Lib/fontTools/feaLib/testdata/spec4h1.ttx
+++ b/Lib/fontTools/feaLib/testdata/spec4h1.ttx
@@ -2,150 +2,146 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Lib/fontTools/feaLib/testdata/spec5d1.ttx b/Lib/fontTools/feaLib/testdata/spec5d1.ttx
index 001ab4bac..34ecbd346 100644
--- a/Lib/fontTools/feaLib/testdata/spec5d1.ttx
+++ b/Lib/fontTools/feaLib/testdata/spec5d1.ttx
@@ -2,73 +2,69 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Lib/fontTools/feaLib/testdata/spec5d2.ttx b/Lib/fontTools/feaLib/testdata/spec5d2.ttx
index f5cfa1090..a63b610a9 100644
--- a/Lib/fontTools/feaLib/testdata/spec5d2.ttx
+++ b/Lib/fontTools/feaLib/testdata/spec5d2.ttx
@@ -2,69 +2,65 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+