Repository: googlefonts/ufo2ft
Pull request #458 (2021-02-05 22:14:53)

Add insertFeatureMarker to BaseFeatureWriter 
This moves and merges the kernFeatureWriter and markFeatureWriter logic for inserting the class definitions, mark class definitions, lookups and feature block into BaseFeatureWriter._insert().
It also add insertFeatureMarker attribute to BaseFeatureWriter.

The insertFeatureMarker can be used like in Glyphs3, a single `\s*# Automatic Code` comment in a feature block.
Depending on where the insertFeatureMarker is found in a comment in a feature block, the BaseFeatureWriter inserts the automatic code before if at the top, after if at the bottom.
At the moment it cannot be in between other rules, for which case Glyphs.app 3 adds new blocks between two blocks split from the original one.

This doesn't handle the FontLab 7 syntax which has a start feature marker and an end feature marker, a pair of `#> feature` and `#< feature` comments in a feature block.

This replaces [Allow insertion markers for autogenerated features #352](https://github.com/googlefonts/ufo2ft/pull/352).
But it instead doesn't allow insertFeatureMarker to be outside a feature block. A blank feature block with the insertFeatureMarker can be used to produce the same effect.

The insertFeatureMarker is only taken into account in the default mode, the "skip" mode.
If a feature block is present but doesn't have an insertFeatureMarker comment, the feature is not inserted.
If a feature block is present and has an insertFeatureMarker comment, the feature is inserted there.
If no feature block is present, the feature is appended.

The append mode does not change and always appends the generated feature block.


Patch:
diff --git a/Lib/ufo2ft/__init__.py b/Lib/ufo2ft/__init__.py
index 06c61b7..2efb3a4 100644
--- a/Lib/ufo2ft/__init__.py
+++ b/Lib/ufo2ft/__init__.py
@@ -100,8 +100,8 @@ def compileOTF(
 
     *subroutinizer* (Optional[str]) is the name of the library to use for
       compressing CFF charstrings, if subroutinization is enabled by optimizeCFF
-      parameter. Choose between "cffsubr" or "compreffor".
-      By default "cffsubr" is used for both CFF 1 and CFF 2.
+      parameter. Choose between "compreffor" or "cffsubr".
+      By default "compreffor" is used for CFF 1, and "cffsubr" for CFF 2.
       NOTE: cffsubr is required for subroutinizing CFF2 tables, as compreffor
       currently doesn't support it.
     """
diff --git a/Lib/ufo2ft/errors.py b/Lib/ufo2ft/errors.py
index ab599dd..80dbb4b 100644
--- a/Lib/ufo2ft/errors.py
+++ b/Lib/ufo2ft/errors.py
@@ -10,6 +10,12 @@ class InvalidFontData(Error):
     pass
 
 
+class InvalidFeaturesData(Error):
+    """Raised when input font contains invalid features data."""
+
+    pass
+
+
 class InvalidDesignSpaceData(Error):
     """Raised when input DesignSpace document contains invalid data."""
 
diff --git a/Lib/ufo2ft/featureWriters/ast.py b/Lib/ufo2ft/featureWriters/ast.py
index f501496..09644e7 100644
--- a/Lib/ufo2ft/featureWriters/ast.py
+++ b/Lib/ufo2ft/featureWriters/ast.py
@@ -49,6 +49,21 @@ def findFeatureTags(feaFile):
     return {f.name for f in iterFeatureBlocks(feaFile)}
 
 
+def findCommentPattern(feaFile, pattern):
+    """
+    Yield a tuple of statements, starting with the parent block, followed by
+    nested blocks if present, ending with the comment matching a given pattern.
+    There is not parent block if the matched comment is a the root level.
+    """
+    for statement in feaFile.statements:
+        if hasattr(statement, "statements"):
+            for res in findCommentPattern(statement, pattern):
+                yield (statement, *res)
+        elif isinstance(statement, ast.Comment):
+            if re.match(pattern, str(statement)):
+                yield (statement,)
+
+
 def iterClassDefinitions(feaFile, featureTag=None):
     if featureTag is None:
         # start from top-level class definitions
diff --git a/Lib/ufo2ft/featureWriters/baseFeatureWriter.py b/Lib/ufo2ft/featureWriters/baseFeatureWriter.py
index 4e51cfb..b426d05 100644
--- a/Lib/ufo2ft/featureWriters/baseFeatureWriter.py
+++ b/Lib/ufo2ft/featureWriters/baseFeatureWriter.py
@@ -2,8 +2,11 @@ import logging
 from collections import OrderedDict
 from types import SimpleNamespace
 
+from ufo2ft.errors import InvalidFeaturesData
 from ufo2ft.featureWriters import ast
 
+INSERT_FEATURE_MARKER = r"\s*# Automatic Code"
+
 
 class BaseFeatureWriter:
     """Abstract features writer.
@@ -33,6 +36,7 @@ class BaseFeatureWriter:
     tableTag = None
     features = frozenset()
     mode = "skip"
+    insertFeatureMarker = INSERT_FEATURE_MARKER
     options = {}
 
     _SUPPORTED_MODES = frozenset(["skip", "append"])
@@ -78,12 +82,24 @@ class BaseFeatureWriter:
         Returns the context namespace instance.
         """
         todo = set(self.features)
+        insertComments = None
         if self.mode == "skip":
+            insertComments = self.collectInsertMarkers(
+                feaFile, self.insertFeatureMarker, todo
+            )
+            # find existing feature blocks
             existing = ast.findFeatureTags(feaFile)
+            # ignore features with insert marker
+            existing.difference_update(insertComments.keys())
+            # remove existing feature without insert marker from todo list
             todo.difference_update(existing)
 
         self.context = SimpleNamespace(
-            font=font, feaFile=feaFile, compiler=compiler, todo=todo
+            font=font,
+            feaFile=feaFile,
+            compiler=compiler,
+            todo=todo,
+            insertComments=insertComments,
         )
 
         return self.context
@@ -119,6 +135,117 @@ class BaseFeatureWriter:
         """Subclasses must override this."""
         raise NotImplementedError
 
+    def _insert(
+        self,
+        feaFile,
+        classDefs=None,
+        anchorDefs=None,
+        markClassDefs=None,
+        lookups=None,
+        features=None,
+    ):
+        """
+        Insert feature, its classDefs or markClassDefs and lookups at insert
+        marker comment.
+
+        If the insert marker is at the top of a feature block, the feature is
+        inserted before that block, and after if the insert marker is at the
+        bottom.
+        """
+
+        statements = feaFile.statements
+
+        # Collect insert markers in blocks
+        insertComments = self.context.insertComments
+
+        wroteOthers = False
+        for feature in features:
+            if insertComments and feature.name in insertComments:
+                block, comment = insertComments[feature.name]
+                markerIndex = block.statements.index(comment)
+
+                onlyCommentsBefore = all(
+                    isinstance(s, ast.Comment) for s in block.statements[:markerIndex]
+                )
+                onlyCommentsAfter = all(
+                    isinstance(s, ast.Comment) for s in block.statements[markerIndex:]
+                )
+
+                # Remove insert marker(s) from feature block.
+                del block.statements[markerIndex]
+
+                # insertFeatureMarker is in a block with only comments.
+                # Replace that block with new feature block.
+                if onlyCommentsBefore and onlyCommentsAfter:
+                    index = statements.index(block)
+                    statements.remove(block)
+
+                # insertFeatureMarker is at the top of a feature block
+                # or only preceded by other comments.
+                elif onlyCommentsBefore:
+                    index = statements.index(block)
+
+                # insertFeatureMarker is at the bottom of a feature block
+                # or only followed by other comments
+                elif onlyCommentsAfter:
+                    index = statements.index(block) + 1
+
+                # insertFeatureMarker is in the middle of a feature block
+                # preceded and followed by statements that are not comments
+                #
+                # Glyphs3 can insert a feature block when rules are before
+                # and after the insert marker.
+                # See
+                # https://github.com/googlefonts/ufo2ft/issues/351#issuecomment-765294436
+                # This is currently not supported.
+                else:
+                    raise InvalidFeaturesData(
+                        "Insert marker has rules before and after, feature "
+                        f"{block.name} cannot be inserted. This is not supported."
+                    )
+
+            else:
+                index = len(statements)
+
+            # Write classDefs, anchorsDefs, markClassDefs, lookups on the first
+            # iteration.
+            if not wroteOthers:
+                others = []
+                # Insert classDefs, anchorsDefs, markClassDefs
+                for defs in [classDefs, anchorDefs, markClassDefs]:
+                    if defs:
+                        others.extend(defs)
+                        others.append(ast.Comment(""))
+                # Insert lookups
+                if lookups:
+                    if index > 0 and not others:
+                        others.append(ast.Comment(""))
+                    others.extend(lookups)
+                if others:
+                    feaFile.statements = statements = (
+                        statements[:index] + others + statements[index:]
+                    )
+                    index = index + len(others)
+                wroteOthers = True
+
+            statements.insert(index, feature)
+
+    @staticmethod
+    def collectInsertMarkers(feaFile, insertFeatureMarker, featureTags):
+        """
+        Returns a dictionary of tuples (block, comment) keyed by feature tag
+        with the block that contains the comment matching the insert feature
+        marker, for given feature tags.
+        """
+        insertComments = dict()
+        for match in ast.findCommentPattern(feaFile, insertFeatureMarker):
+            blocks, comment = match[:-1], match[-1]
+            if len(blocks) == 1 and isinstance(blocks[0], ast.FeatureBlock):
+                block = blocks[0]
+                if block.name in featureTags and block.name not in insertComments:
+                    insertComments[block.name] = (block, comment)
+        return insertComments
+
     def makeUnicodeToGlyphNameMapping(self):
         """Return the Unicode to glyph name mapping for the current font."""
         # Try to get the "best" Unicode cmap subtable if this writer is running
diff --git a/Lib/ufo2ft/featureWriters/kernFeatureWriter.py b/Lib/ufo2ft/featureWriters/kernFeatureWriter.py
index 79b289c..fbd9513 100644
--- a/Lib/ufo2ft/featureWriters/kernFeatureWriter.py
+++ b/Lib/ufo2ft/featureWriters/kernFeatureWriter.py
@@ -237,25 +237,25 @@ class KernFeatureWriter(BaseFeatureWriter):
             return False
 
         # extend feature file with the new generated statements
-        statements = self.context.feaFile.statements
+        feaFile = self.context.feaFile
 
         # first add the glyph class definitions
         side1Classes = self.context.kerning.side1Classes
         side2Classes = self.context.kerning.side2Classes
+        newClassDefs = []
         for classes in (side1Classes, side2Classes):
-            statements.extend([c for _, c in sorted(classes.items())])
+            newClassDefs.extend([c for _, c in sorted(classes.items())])
 
-        # add empty line to separate classes from following statements
-        if statements:
-            statements.append(ast.Comment(""))
-
-        # finally add the lookup and feature blocks
+        lookupGroups = []
         for _, lookupGroup in sorted(lookups.items()):
-            statements.extend(lookupGroup)
-        if "kern" in features:
-            statements.append(features["kern"])
-        if "dist" in features:
-            statements.append(features["dist"])
+            lookupGroups.extend(lookupGroup)
+
+        self._insert(
+            feaFile=feaFile,
+            classDefs=newClassDefs,
+            lookups=lookupGroups,
+            features=[features[tag] for tag in ["kern", "dist"] if tag in features],
+        )
         return True
 
     @classmethod
diff --git a/Lib/ufo2ft/featureWriters/markFeatureWriter.py b/Lib/ufo2ft/featureWriters/markFeatureWriter.py
index 142e57b..0db8f0f 100644
--- a/Lib/ufo2ft/featureWriters/markFeatureWriter.py
+++ b/Lib/ufo2ft/featureWriters/markFeatureWriter.py
@@ -875,9 +875,11 @@ class MarkFeatureWriter(BaseFeatureWriter):
             return False
 
         feaFile = self.context.feaFile
-        feaFile.statements.extend(newClassDefs)
-        # add empty line to separate classes from following statements
-        feaFile.statements.append(ast.Comment(""))
-        for _, feature in sorted(features.items()):
-            feaFile.statements.append(feature)
+
+        self._insert(
+            feaFile=feaFile,
+            markClassDefs=newClassDefs,
+            features=[features[tag] for tag in sorted(features.keys())],
+        )
+
         return True
diff --git a/Lib/ufo2ft/postProcessor.py b/Lib/ufo2ft/postProcessor.py
index 02d2d32..99ff410 100644
--- a/Lib/ufo2ft/postProcessor.py
+++ b/Lib/ufo2ft/postProcessor.py
@@ -31,9 +31,10 @@ class PostProcessor:
         COMPREFFOR = "compreffor"
         CFFSUBR = "cffsubr"
 
+    # keep defaulting to compreffor for CFF 1.0, use cffsubr for CFF2;
     # can override by passing explicit subroutinizer parameter to process method
     DEFAULT_SUBROUTINIZER_FOR_CFF_VERSION = {
-        1: SubroutinizerBackend.CFFSUBR,
+        1: SubroutinizerBackend.COMPREFFOR,
         2: SubroutinizerBackend.CFFSUBR,
     }
 
@@ -90,8 +91,8 @@ class PostProcessor:
 
         subroutinizer (Optional[str]):
           The name of the library to use for compressing CFF charstrings, if optimizeCFF
-          is True and CFF or CFF2 table is present. Choose between "cffsubr" or
-          "compreffor". By default "cffsubr" is used for both CFF 1 and CFF 2.
+          is True and CFF or CFF2 table is present. Choose between "compreffor" or
+          "cffsubr". By default "compreffor" is used for CFF 1, and "cffsubr" for CFF 2.
           NOTE: compreffor currently doesn't support input fonts with CFF2 table.
         """
         if self._get_cff_version(self.otf):
diff --git a/requirements.txt b/requirements.txt
index a40eb30..84009e8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,7 @@ defcon==0.7.2
 cu2qu==1.6.7
 compreffor==0.5.0
 booleanOperations==0.9.0
-cffsubr==0.2.8
+cffsubr==0.2.7
 skia-pathops==0.5.1.post1
 
 # alternative UFO implementation
diff --git a/setup.py b/setup.py
index 3afe48f..175429a 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ setup(
     ],
     extras_require={
         "pathops": ["skia-pathops>=0.5.1"],
-        "cffsubr": ["cffsubr>=0.2.8"],
+        "cffsubr": ["cffsubr>=0.2.7"],
     },
     python_requires=">=3.6",
     classifiers=[


Test patch:
diff --git a/tests/data/TestFont-CFF-compreffor.ttx b/tests/data/TestFont-CFF-cffsubr.ttx
similarity index 91%
rename from tests/data/TestFont-CFF-compreffor.ttx
rename to tests/data/TestFont-CFF-cffsubr.ttx
index a5462ad..167e7a6 100644
--- a/tests/data/TestFont-CFF-compreffor.ttx
+++ b/tests/data/TestFont-CFF-cffsubr.ttx
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ttFont sfntVersion="OTTO" ttLibVersion="4.10">
+<ttFont sfntVersion="OTTO" ttLibVersion="4.11">
 
   <GlyphOrder>
     <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
@@ -253,12 +253,10 @@
       <FontBBox value="-55 -280 454 750"/>
       <StrokeWidth value="0"/>
       <!-- charset is dumped separately as the 'GlyphOrder' element -->
-      <Encoding name="StandardEncoding"/>
+      <Encoding>
+      </Encoding>
       <Private>
         <BlueValues value="500 510"/>
-        <OtherBlues value="-250 -260"/>
-        <FamilyBlues value="500 510"/>
-        <FamilyOtherBlues value="-250 -260"/>
         <BlueScale value="0.039625"/>
         <BlueShift value="7"/>
         <BlueFuzz value="1"/>
@@ -270,108 +268,126 @@
         <LanguageGroup value="0"/>
         <ExpansionFactor value="0.06"/>
         <initialRandomSeed value="0"/>
-        <defaultWidthX value="400"/>
-        <nominalWidthX value="400"/>
+        <defaultWidthX value="600"/>
+        <nominalWidthX value="357"/>
         <Subrs>
           <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
           <CharString index="0">
-            256 hlineto
-            -128 510 rlineto
-            endchar
-          </CharString>
-          <CharString index="1">
-            200 -55 -80 rmoveto
+            -55 -80 rmoveto
             509 hlineto
-            149 -50 50 -205 -204 -50 -50 -149 vhcurveto
+            149 -98 callsubr
+            -149 vhcurveto
             121 return
           </CharString>
-          <CharString index="2">
+          <CharString index="1">
             rmoveto
             509 hlineto
-            150 -50 50 -205 -204 -50 -50 -150 vhcurveto
+            150 -98 callsubr
+            -150 vhcurveto
             endchar
           </CharString>
-          <CharString index="3">
+          <CharString index="2">
             rmoveto
             -34 -27 -27 -33 -33 27 -27 34 33 27 27 33 33 -27 27 -33 hvcurveto
             return
           </CharString>
+          <CharString index="3">
+            -102 callsubr
+            endchar
+          </CharString>
+          <CharString index="4">
+            rmoveto
+            -99 callsubr
+            endchar
+          </CharString>
+          <CharString index="5">
+            66 -100 callsubr
+            return
+          </CharString>
+          <CharString index="6">
+            rmoveto
+            -510 210 510 vlineto
+            endchar
+          </CharString>
+          <CharString index="7">
+            hmoveto
+            -99 callsubr
+            return
+          </CharString>
+          <CharString index="8">
+            256 hlineto
+            -128 510 rlineto
+            return
+          </CharString>
+          <CharString index="9">
+            -50 50 -205 -204 -50 -50 return
+          </CharString>
         </Subrs>
       </Private>
       <CharStrings>
         <CharString name=".notdef">
-          100 450 hmoveto
+          143 450 hmoveto
           750 -400 -750 vlineto
           350 50 rmoveto
           -300 650 300 hlineto
           endchar
         </CharString>
         <CharString name="uni0020">
-          -150 endchar
+          -107 endchar
         </CharString>
         <CharString name="uni0061">
-          -12 66 hmoveto
-          -107 callsubr
+          31 -104 callsubr
         </CharString>
         <CharString name="uni0062">
-          10 100 505 rmoveto
-          -510 210 510 vlineto
-          endchar
+          53 100 505 -101 callsubr
         </CharString>
         <CharString name="uni0063">
-          -26 300 -10 rmoveto
+          17 300 -10 rmoveto
           510 vlineto
           -150 -50 -50 -205 -205 50 -50 150 hvcurveto
           endchar
         </CharString>
         <CharString name="uni0064">
-          -26 151 197 -104 callsubr
+          17 151 197 -105 callsubr
           endchar
         </CharString>
         <CharString name="uni0065">
-          -12 66 510 rmoveto
+          31 66 510 rmoveto
           128 -435 128 435 rlineto
-          -377 -487 -105 callsubr
+          -377 -487 -106 callsubr
         </CharString>
         <CharString name="uni0066">
-          10 66 510 rmoveto
+          53 66 510 rmoveto
           256 hlineto
           -128 -435 rlineto
-          -249 -52 -105 callsubr
+          -249 -52 -106 callsubr
         </CharString>
         <CharString name="uni0067">
-          -12 66 hmoveto
-          -107 callsubr
+          31 -104 callsubr
         </CharString>
         <CharString name="uni0068">
-          10 211 657 -104 callsubr
-          -111 -152 rmoveto
-          -510 210 510 vlineto
-          endchar
+          53 211 657 -105 callsubr
+          -111 -152 -101 callsubr
         </CharString>
         <CharString name="uni0069">
-          -106 callsubr
-          80 rmoveto
           -107 callsubr
+          80 -103 callsubr
         </CharString>
         <CharString name="uni006A">
-          -106 callsubr
+          -107 callsubr
           310 rmoveto
           128 -510 128 510 rlineto
           endchar
         </CharString>
         <CharString name="uni006B">
-          200 66 hmoveto
-          256 hlineto
-          -128 510 rlineto
-          -28 -510 rmoveto
-          -107 callsubr
+          -102 callsubr
+          -28 -510 -103 callsubr
         </CharString>
         <CharString name="uni006C">
-          200 334 hmoveto
+          334 hmoveto
           -128 510 -128 -510 rlineto
-          88 hmoveto
-          -107 callsubr
+          88 -100 callsubr
+          endchar
         </CharString>
       </CharStrings>
     </CFFFont>
diff --git a/tests/data/TestFont-CFF.ttx b/tests/data/TestFont-CFF.ttx
index 167e7a6..a5462ad 100644
--- a/tests/data/TestFont-CFF.ttx
+++ b/tests/data/TestFont-CFF.ttx
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ttFont sfntVersion="OTTO" ttLibVersion="4.11">
+<ttFont sfntVersion="OTTO" ttLibVersion="4.10">
 
   <GlyphOrder>
     <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
@@ -253,10 +253,12 @@
       <FontBBox value="-55 -280 454 750"/>
       <StrokeWidth value="0"/>
       <!-- charset is dumped separately as the 'GlyphOrder' element -->
-      <Encoding>
-      </Encoding>
+      <Encoding name="StandardEncoding"/>
       <Private>
         <BlueValues value="500 510"/>
+        <OtherBlues value="-250 -260"/>
+        <FamilyBlues value="500 510"/>
+        <FamilyOtherBlues value="-250 -260"/>
         <BlueScale value="0.039625"/>
         <BlueShift value="7"/>
         <BlueFuzz value="1"/>
@@ -268,126 +270,108 @@
         <LanguageGroup value="0"/>
         <ExpansionFactor value="0.06"/>
         <initialRandomSeed value="0"/>
-        <defaultWidthX value="600"/>
-        <nominalWidthX value="357"/>
+        <defaultWidthX value="400"/>
+        <nominalWidthX value="400"/>
         <Subrs>
           <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
           <CharString index="0">
-            -55 -80 rmoveto
-            509 hlineto
-            149 -98 callsubr
-            -149 vhcurveto
-            121 return
+            256 hlineto
+            -128 510 rlineto
+            endchar
           </CharString>
           <CharString index="1">
-            rmoveto
+            200 -55 -80 rmoveto
             509 hlineto
-            150 -98 callsubr
-            -150 vhcurveto
-            endchar
+            149 -50 50 -205 -204 -50 -50 -149 vhcurveto
+            121 return
           </CharString>
           <CharString index="2">
             rmoveto
-            -34 -27 -27 -33 -33 27 -27 34 33 27 27 33 33 -27 27 -33 hvcurveto
-            return
-          </CharString>
-          <CharString index="3">
-            -102 callsubr
-            endchar
-          </CharString>
-          <CharString index="4">
-            rmoveto
-            -99 callsubr
+            509 hlineto
+            150 -50 50 -205 -204 -50 -50 -150 vhcurveto
             endchar
           </CharString>
-          <CharString index="5">
-            66 -100 callsubr
-            return
-          </CharString>
-          <CharString index="6">
+          <CharString index="3">
             rmoveto
-            -510 210 510 vlineto
-            endchar
-          </CharString>
-          <CharString index="7">
-            hmoveto
-            -99 callsubr
-            return
-          </CharString>
-          <CharString index="8">
-            256 hlineto
-            -128 510 rlineto
+            -34 -27 -27 -33 -33 27 -27 34 33 27 27 33 33 -27 27 -33 hvcurveto
             return
           </CharString>
-          <CharString index="9">
-            -50 50 -205 -204 -50 -50 return
-          </CharString>
         </Subrs>
       </Private>
       <CharStrings>
         <CharString name=".notdef">
-          143 450 hmoveto
+          100 450 hmoveto
           750 -400 -750 vlineto
           350 50 rmoveto
           -300 650 300 hlineto
           endchar
         </CharString>
         <CharString name="uni0020">
-          -107 endchar
+          -150 endchar
         </CharString>
         <CharString name="uni0061">
-          31 -104 callsubr
+          -12 66 hmoveto
+          -107 callsubr
         </CharString>
         <CharString name="uni0062">
-          53 100 505 -101 callsubr
+          10 100 505 rmoveto
+          -510 210 510 vlineto
+          endchar
         </CharString>
         <CharString name="uni0063">
-          17 300 -10 rmoveto
+          -26 300 -10 rmoveto
           510 vlineto
           -150 -50 -50 -205 -205 50 -50 150 hvcurveto
           endchar
         </CharString>
         <CharString name="uni0064">
-          17 151 197 -105 callsubr
+          -26 151 197 -104 callsubr
           endchar
         </CharString>
         <CharString name="uni0065">
-          31 66 510 rmoveto
+          -12 66 510 rmoveto
           128 -435 128 435 rlineto
-          -377 -487 -106 callsubr
+          -377 -487 -105 callsubr
         </CharString>
         <CharString name="uni0066">
-          53 66 510 rmoveto
+          10 66 510 rmoveto
           256 hlineto
           -128 -435 rlineto
-          -249 -52 -106 callsubr
+          -249 -52 -105 callsubr
         </CharString>
         <CharString name="uni0067">
-          31 -104 callsubr
+          -12 66 hmoveto
+          -107 callsubr
         </CharString>
         <CharString name="uni0068">
-          53 211 657 -105 callsubr
-          -111 -152 -101 callsubr
+          10 211 657 -104 callsubr
+          -111 -152 rmoveto
+          -510 210 510 vlineto
+          endchar
         </CharString>
         <CharString name="uni0069">
+          -106 callsubr
+          80 rmoveto
           -107 callsubr
-          80 -103 callsubr
         </CharString>
         <CharString name="uni006A">
-          -107 callsubr
+          -106 callsubr
           310 rmoveto
           128 -510 128 510 rlineto
           endchar
         </CharString>
         <CharString name="uni006B">
-          -102 callsubr
-          -28 -510 -103 callsubr
+          200 66 hmoveto
+          256 hlineto
+          -128 510 rlineto
+          -28 -510 rmoveto
+          -107 callsubr
         </CharString>
         <CharString name="uni006C">
-          334 hmoveto
+          200 334 hmoveto
           -128 510 -128 -510 rlineto
-          88 -100 callsubr
-          endchar
+          88 hmoveto
+          -107 callsubr
         </CharString>
       </CharStrings>
     </CFFFont>
diff --git a/tests/data/TestFont-NoOverlaps-CFF-pathops.ttx b/tests/data/TestFont-NoOverlaps-CFF-pathops.ttx
index 35d0b22..696dc6d 100644
--- a/tests/data/TestFont-NoOverlaps-CFF-pathops.ttx
+++ b/tests/data/TestFont-NoOverlaps-CFF-pathops.ttx
@@ -253,10 +253,12 @@
       <FontBBox value="-55 -280 454 750"/>
       <StrokeWidth value="0"/>
       <!-- charset is dumped separately as the 'GlyphOrder' element -->
-      <Encoding>
-      </Encoding>
+      <Encoding name="StandardEncoding"/>
       <Private>
         <BlueValues value="500 510"/>
+        <OtherBlues value="-250 -260"/>
+        <FamilyBlues value="500 510"/>
+        <FamilyOtherBlues value="-250 -260"/>
         <BlueScale value="0.039625"/>
         <BlueShift value="7"/>
         <BlueFuzz value="1"/>
@@ -268,15 +270,11 @@
         <LanguageGroup value="0"/>
         <ExpansionFactor value="0.06"/>
         <initialRandomSeed value="0"/>
-        <defaultWidthX value="600"/>
-        <nominalWidthX value="357"/>
+        <defaultWidthX value="400"/>
+        <nominalWidthX value="400"/>
         <Subrs>
           <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
           <CharString index="0">
-            hlineto
-            -128 510 return
-          </CharString>
-          <CharString index="1">
             66 510 rmoveto
             85 -288 rlineto
             -164 -8 -42 -54 -137 vvcurveto
@@ -285,62 +283,50 @@
             85 288 rlineto
             return
           </CharString>
-          <CharString index="2">
+          <CharString index="1">
             rmoveto
             -34 -27 -27 -33 -33 27 -27 34 33 27 27 33 33 -27 27 -33 hvcurveto
             endchar
           </CharString>
-          <CharString index="3">
-            66 hmoveto
-            256 -107 callsubr
-            rlineto
-            endchar
-          </CharString>
-          <CharString index="4">
-            100 505 rmoveto
-            -510 210 510 vlineto
-            return
-          </CharString>
-          <CharString index="5">
-            hlineto
-            123 -34 55 -127 16 vhcurveto
-            return
-          </CharString>
         </Subrs>
       </Private>
       <CharStrings>
         <CharString name=".notdef">
-          143 450 hmoveto
+          100 450 hmoveto
           750 -400 -750 vlineto
           350 50 rmoveto
           -300 650 300 hlineto
           endchar
         </CharString>
         <CharString name="uni0020">
-          -107 endchar
+          -150 endchar
         </CharString>
         <CharString name="uni0061">
-          31 -104 callsubr
+          -12 66 hmoveto
+          256 hlineto
+          -128 510 rlineto
+          endchar
         </CharString>
         <CharString name="uni0062">
-          53 -103 callsubr
+          10 100 505 rmoveto
+          -510 210 510 vlineto
           endchar
         </CharString>
         <CharString name="uni0063">
-          17 300 -10 rmoveto
+          -26 300 -10 rmoveto
           510 vlineto
           -150 -50 -50 -205 -205 50 -50 150 hvcurveto
           endchar
         </CharString>
         <CharString name="uni0064">
-          17 151 197 -105 callsubr
+          -26 151 197 -106 callsubr
         </CharString>
         <CharString name="uni0065">
-          31 -106 callsubr
+          -12 -107 callsubr
           endchar
         </CharString>
         <CharString name="uni0066">
-          53 -106 callsubr
+          10 -107 callsubr
           -85 -288 rmoveto
           -43 -147 -43 147 rlineto
           1 15 16 0 17 hhcurveto
@@ -348,40 +334,44 @@
           endchar
         </CharString>
         <CharString name="uni0067">
-          31 -104 callsubr
+          -12 66 hmoveto
+          256 hlineto
+          -128 510 rlineto
+          endchar
         </CharString>
         <CharString name="uni0068">
-          53 -103 callsubr
-          -99 152 -105 callsubr
+          10 100 505 rmoveto
+          -510 210 510 vlineto
+          -99 152 -106 callsubr
         </CharString>
         <CharString name="uni0069">
-          -55 -80 rmoveto
-          509 -102 callsubr
+          200 -55 -80 rmoveto
+          509 hlineto
+          123 -34 55 -127 16 vhcurveto
           -99 396 -100 -397 rlineto
           -117 -18 -32 -56 -119 vvcurveto
           endchar
         </CharString>
         <CharString name="uni006A">
-          -55 -80 rmoveto
+          200 -55 -80 rmoveto
           199 hlineto
           50 -200 50 200 rlineto
-          210 -102 callsubr
-          29 116 rlineto
-          -256 hlineto
-          29 -117 rlineto
+          210 hlineto
+          123 -34 55 -127 16 vhcurveto
+          29 116 -256 0 29 -117 rlineto
           -118 -18 -32 -55 -120 vvcurveto
           endchar
         </CharString>
         <CharString name="uni006B">
-          66 hmoveto
-          356 -107 callsubr
-          -50 -199 -50 199 rlineto
+          200 66 hmoveto
+          356 hlineto
+          -128 510 -50 -199 -50 199 rlineto
           endchar
         </CharString>
         <CharString name="uni006C">
-          334 hmoveto
-          88 -107 callsubr
-          -44 -175 -44 175 -128 -510 rlineto
+          200 334 hmoveto
+          88 hlineto
+          -128 510 -44 -175 -44 175 -128 -510 rlineto
           endchar
         </CharString>
       </CharStrings>
diff --git a/tests/data/TestFont-NoOverlaps-CFF.ttx b/tests/data/TestFont-NoOverlaps-CFF.ttx
index 3c3015e..302debb 100644
--- a/tests/data/TestFont-NoOverlaps-CFF.ttx
+++ b/tests/data/TestFont-NoOverlaps-CFF.ttx
@@ -253,10 +253,12 @@
       <FontBBox value="-55 -280 454 750"/>
       <StrokeWidth value="0"/>
       <!-- charset is dumped separately as the 'GlyphOrder' element -->
-      <Encoding>
-      </Encoding>
+      <Encoding name="StandardEncoding"/>
       <Private>
         <BlueValues value="500 510"/>
+        <OtherBlues value="-250 -260"/>
+        <FamilyBlues value="500 510"/>
+        <FamilyOtherBlues value="-250 -260"/>
         <BlueScale value="0.039625"/>
         <BlueShift value="7"/>
         <BlueFuzz value="1"/>
@@ -268,17 +270,15 @@
         <LanguageGroup value="0"/>
         <ExpansionFactor value="0.06"/>
         <initialRandomSeed value="0"/>
-        <defaultWidthX value="600"/>
-        <nominalWidthX value="357"/>
+        <defaultWidthX value="400"/>
+        <nominalWidthX value="400"/>
         <Subrs>
           <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
           <CharString index="0">
             -55 23 rmoveto
             509 hlineto
             140 -44 53 -173 6 vhcurveto
-            85 288 rlineto
-            -256 hlineto
-            85 -288 rlineto
+            85 288 -256 0 85 -288 rlineto
             -164 -8 -42 -54 -137 vvcurveto
             return
           </CharString>
@@ -287,57 +287,46 @@
             -34 -27 -27 -33 -33 27 -27 34 33 27 27 33 33 -27 27 -33 hvcurveto
             return
           </CharString>
-          <CharString index="2">
-            66 hmoveto
-            256 hlineto
-            -128 510 rlineto
-            endchar
-          </CharString>
-          <CharString index="3">
-            rmoveto
-            -510 210 510 vlineto
-            endchar
-          </CharString>
-          <CharString index="4">
-            hlineto
-            123 -34 55 -127 16 vhcurveto
-            return
-          </CharString>
         </Subrs>
       </Private>
       <CharStrings>
         <CharString name=".notdef">
-          143 450 hmoveto
+          100 450 hmoveto
           750 -400 -750 vlineto
           350 50 rmoveto
           -300 650 300 hlineto
           endchar
         </CharString>
         <CharString name="uni0020">
-          -107 endchar
+          -150 endchar
         </CharString>
         <CharString name="uni0061">
-          31 -105 callsubr
+          -12 66 hmoveto
+          256 hlineto
+          -128 510 rlineto
+          endchar
         </CharString>
         <CharString name="uni0062">
-          53 100 505 -104 callsubr
+          10 100 505 rmoveto
+          -510 210 510 vlineto
+          endchar
         </CharString>
         <CharString name="uni0063">
-          17 300 -10 rmoveto
+          -26 300 -10 rmoveto
           510 vlineto
           -150 -50 -50 -205 -205 50 -50 150 hvcurveto
           endchar
         </CharString>
         <CharString name="uni0064">
-          17 151 197 -106 callsubr
+          -26 151 197 -106 callsubr
           endchar
         </CharString>
         <CharString name="uni0065">
-          31 -107 callsubr
+          -12 -107 callsubr
           endchar
         </CharString>
         <CharString name="uni0066">
-          53 -107 callsubr
+          10 -107 callsubr
           254 200 rmoveto
           13 13 0 -1 12 hvcurveto
           -43 -147 -43 147 rlineto
@@ -345,38 +334,43 @@
           endchar
         </CharString>
         <CharString name="uni0067">
-          31 -105 callsubr
+          -12 66 hmoveto
+          256 hlineto
+          -128 510 rlineto
+          endchar
         </CharString>
         <CharString name="uni0068">
-          53 211 657 -106 callsubr
-          -111 -152 -104 callsubr
+          10 211 657 -106 callsubr
+          -111 -152 rmoveto
+          -510 210 510 vlineto
+          endchar
         </CharString>
         <CharString name="uni0069">
-          -55 -80 rmoveto
-          509 -103 callsubr
+          200 -55 -80 rmoveto
+          509 hlineto
+          123 -34 55 -127 16 vhcurveto
           -99 396 -100 -397 rlineto
           -117 -18 -32 -56 -119 vvcurveto
           endchar
         </CharString>
         <CharString name="uni006A">
-          -55 -80 rmoveto
+          200 -55 -80 rmoveto
           199 hlineto
           50 -200 50 200 rlineto
-          210 -103 callsubr
-          29 116 rlineto
-          -256 hlineto
-          29 -117 rlineto
+          210 hlineto
+          123 -34 55 -127 16 vhcurveto
+          29 116 -256 0 29 -117 rlineto
           -118 -18 -32 -55 -120 vvcurveto
           endchar
         </CharString>
         <CharString name="uni006B">
-          66 hmoveto
+          200 66 hmoveto
           356 hlineto
           -128 510 -50 -199 -50 199 rlineto
           endchar
         </CharString>
         <CharString name="uni006C">
-          294 510 rmoveto
+          200 294 510 rmoveto
           -44 -175 -44 175 -128 -510 rlineto
           344 hlineto
           endchar
diff --git a/tests/data/TestVariableFont-CFF2-post3.ttx b/tests/data/TestVariableFont-CFF2-post3.ttx
deleted file mode 100644
index 5800e86..0000000
--- a/tests/data/TestVariableFont-CFF2-post3.ttx
+++ /dev/null
@@ -1,547 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ttFont>
-
-  <GlyphOrder>
-    <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
-    <GlyphID id="0" name=".notdef"/>
-    <GlyphID id="1" name="a"/>
-    <GlyphID id="2" name="e"/>
-    <GlyphID id="3" name="s"/>
-    <GlyphID id="4" name="uni0307"/>
-    <GlyphID id="5" name="edotaccent"/>
-  </GlyphOrder>
-
-  <head>
-    <!-- Most of this table will be recalculated by the compiler -->
-    <tableVersion value="1.0"/>
-    <fontRevision value="0.0"/>
-    <checkSumAdjustment value="0x12345678"/>
-    <magicNumber value="0x5f0f3cf5"/>
-    <flags value="00000000 00000011"/>
-    <unitsPerEm value="1000"/>
-    <created value="Fri Feb 17 17:17:17 2017"/>
-    <modified value="Sun Feb 18 18:18:18 2018"/>
-    <xMin value="-37"/>
-    <yMin value="-250"/>
-    <xMax value="582"/>
-    <yMax value="750"/>
-    <macStyle value="00000000 00000000"/>
-    <lowestRecPPEM value="6"/>
-    <fontDirectionHint value="2"/>
-    <indexToLocFormat value="0"/>
-    <glyphDataFormat value="0"/>
-  </head>
-
-  <hhea>
-    <tableVersion value="0x00010000"/>
-    <ascent value="950"/>
-    <descent value="-250"/>
-    <lineGap value="0"/>
-    <advanceWidthMax value="600"/>
-    <minLeftSideBearing value="-37"/>
-    <minRightSideBearing value="-50"/>
-    <xMaxExtent value="582"/>
-    <caretSlopeRise value="1"/>
-    <caretSlopeRun value="0"/>
-    <caretOffset value="0"/>
-    <reserved0 value="0"/>
-    <reserved1 value="0"/>
-    <reserved2 value="0"/>
-    <reserved3 value="0"/>
-    <metricDataFormat value="0"/>
-    <numberOfHMetrics value="6"/>
-  </hhea>
-
-  <maxp>
-    <tableVersion value="0x5000"/>
-    <numGlyphs value="6"/>
-  </maxp>
-
-  <OS_2>
-    <!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
-         will be recalculated by the compiler -->
-    <version value="4"/>
-    <xAvgCharWidth value="580"/>
-    <usWeightClass value="350"/>
-    <usWidthClass value="5"/>
-    <fsType value="00000000 00000100"/>
-    <ySubscriptXSize value="650"/>
-    <ySubscriptYSize value="600"/>
-    <ySubscriptXOffset value="0"/>
-    <ySubscriptYOffset value="75"/>
-    <ySuperscriptXSize value="650"/>
-    <ySuperscriptYSize value="600"/>
-    <ySuperscriptXOffset value="0"/>
-    <ySuperscriptYOffset value="350"/>
-    <yStrikeoutSize value="50"/>
-    <yStrikeoutPosition value="300"/>
-    <sFamilyClass value="0"/>
-    <panose>
-      <bFamilyType value="0"/>
-      <bSerifStyle value="0"/>
-      <bWeight value="0"/>
-      <bProportion value="0"/>
-      <bContrast value="0"/>
-      <bStrokeVariation value="0"/>
-      <bArmStyle value="0"/>
-      <bLetterForm value="0"/>
-      <bMidline value="0"/>
-      <bXHeight value="0"/>
-    </panose>
-    <ulUnicodeRange1 value="00000000 00000000 00000000 01000101"/>
-    <ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
-    <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
-    <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
-    <achVendID value="NONE"/>
-    <fsSelection value="00000000 01000000"/>
-    <usFirstCharIndex value="97"/>
-    <usLastCharIndex value="775"/>
-    <sTypoAscender value="750"/>
-    <sTypoDescender value="-250"/>
-    <sTypoLineGap value="200"/>
-    <usWinAscent value="950"/>
-    <usWinDescent value="250"/>
-    <ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
-    <ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
-    <sxHeight value="500"/>
-    <sCapHeight value="700"/>
-    <usDefaultChar value="0"/>
-    <usBreakChar value="32"/>
-    <usMaxContext value="4"/>
-  </OS_2>
-
-  <hmtx>
-    <mtx name=".notdef" width="500" lsb="50"/>
-    <mtx name="a" width="600" lsb="9"/>
-    <mtx name="e" width="600" lsb="40"/>
-    <mtx name="edotaccent" width="600" lsb="40"/>
-    <mtx name="s" width="600" lsb="25"/>
-    <mtx name="uni0307" width="0" lsb="-37"/>
-  </hmtx>
-
-  <cmap>
-    <tableVersion version="0"/>
-    <cmap_format_4 platformID="0" platEncID="3" language="0">
-      <map code="0x61" name="a"/><!-- LATIN SMALL LETTER A -->
-      <map code="0x65" name="e"/><!-- LATIN SMALL LETTER E -->
-      <map code="0x73" name="s"/><!-- LATIN SMALL LETTER S -->
-      <map code="0x117" name="edotaccent"/><!-- LATIN SMALL LETTER E WITH DOT ABOVE -->
-      <map code="0x307" name="uni0307"/><!-- COMBINING DOT ABOVE -->
-    </cmap_format_4>
-    <cmap_format_4 platformID="3" platEncID="1" language="0">
-      <map code="0x61" name="a"/><!-- LATIN SMALL LETTER A -->
-      <map code="0x65" name="e"/><!-- LATIN SMALL LETTER E -->
-      <map code="0x73" name="s"/><!-- LATIN SMALL LETTER S -->
-      <map code="0x117" name="edotaccent"/><!-- LATIN SMALL LETTER E WITH DOT ABOVE -->
-      <map code="0x307" name="uni0307"/><!-- COMBINING DOT ABOVE -->
-    </cmap_format_4>
-  </cmap>
-
-  <name>
-    <namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
-      Weight
-    </namerecord>
-    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
-      Layer Font
-    </namerecord>
-    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
-      Regular
-    </namerecord>
-    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
-      0.000;NONE;LayerFont-Regular
-    </namerecord>
-    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
-      Layer Font Regular
-    </namerecord>
-    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
-      Version 0.000
-    </namerecord>
-    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
-      LayerFont-Regular
-    </namerecord>
-    <namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
-      Weight
-    </namerecord>
-  </name>
-
-  <post>
-    <formatType value="3.0"/>
-    <italicAngle value="0.0"/>
-    <underlinePosition value="-75"/>
-    <underlineThickness value="50"/>
-    <isFixedPitch value="0"/>
-    <minMemType42 value="0"/>
-    <maxMemType42 value="0"/>
-    <minMemType1 value="0"/>
-    <maxMemType1 value="0"/>
-  </post>
-
-  <CFF2>
-    <major value="2"/>
-    <minor value="0"/>
-    <CFFFont name="CFF2Font">
-      <FontMatrix value="0.001 0 0 0.001 0 0"/>
-      <FDArray>
-        <FontDict index="0">
-          <Private>
-            <BlueScale value="0.039625"/>
-            <BlueShift value="7"/>
-            <BlueFuzz value="1"/>
-          </Private>
-        </FontDict>
-      </FDArray>
-      <CharStrings>
-        <CharString name=".notdef">
-          50 -250 rmoveto
-          400 1000 -400 hlineto
-          50 -950 rmoveto
-          900 300 -900 vlineto
-        </CharString>
-        <CharString name="a">
-          468 -1 rmoveto
-          -21 435 -233 70 -205 -76 27 -91 -56 1 blend
-          172 60 155 -40 -59 2 2 blend
-          3 -360 56 1 blend
-          rlineto
-          12 266 59 -2 2 blend
-          rmoveto
-          -352 -23 3 -218 139 -34 221 83 -6 63 -222 -60 -75 52 15 40 13 37 -21 5 blend
-          2 46 294 35 -78 -30 2 blend
-          rlineto
-        </CharString>
-        <CharString name="e">
-          1 vsindex
-          127 228 -1 70 -25 1 2 blend
-          rmoveto
-          449 -2 1 -45 -2 -2 2 blend
-          -5 79 -255 208 -276 -252 148 -279 338 63 -17 84 -280 -54 -82 188 170 153 163 -124 -355 6 27 0 0 -27 0 36 0 -29 0 -34 0 31 0 -1 0 2 0 -45 -2 13 28 100 37 0 13 0 -2 55 -40 -54 -32 -86 -30 -57 -85 -60 34 57 84 146 -5 0 21 blend
-          rlineto
-        </CharString>
-        <CharString name="edotaccent">
-          127 228 70 1 2 blend
-          rmoveto
-          449 -2 -45 -2 2 blend
-          -5 79 -255 208 -276 -252 148 -279 338 63 -17 84 -27 36 -29 -34 31 -1 2 -45 13 100 10 blend
-          -280 -54 -82 188 170 153 163 -124 -355 55 -54 -86 -57 -60 57 146 7 blend
-          6 rlineto
-          167 395 -84 118 2 blend
-          rmoveto
-          -16 -94 78 -2 9 88 -19 -48 44 7 -4 29 6 blend
-          rlineto
-        </CharString>
-        <CharString name="s">
-          559 459 rmoveto
-          -235 71 -286 -187 389 -188 -145 -79 -229 98 -28 -91 279 -96 278 187 -369 192 113 76 -22 55 -58 -61 19 49 34 9 9 -56 -2 -41 46 12 29 24 -57 -31 18 blend
-          213 -66 rlineto
-        </CharString>
-        <CharString name="uni0307">
-          -21 597 -8 28 2 blend
-          rmoveto
-          -16 -94 78 -2 9 88 -19 -48 44 7 -4 29 6 blend
-          rlineto
-        </CharString>
-      </CharStrings>
-      <VarStore Format="1">
-        <Format value="1"/>
-        <VarRegionList>
-          <!-- RegionAxisCount=1 -->
-          <!-- RegionCount=3 -->
-          <Region index="0">
-            <VarRegionAxis index="0">
-              <StartCoord value="0.0"/>
-              <PeakCoord value="1.0"/>
-              <EndCoord value="1.0"/>
-            </VarRegionAxis>
-          </Region>
-          <Region index="1">
-            <VarRegionAxis index="0">
-              <StartCoord value="0.0"/>
-              <PeakCoord value="0.36365"/>
-              <EndCoord value="1.0"/>
-            </VarRegionAxis>
-          </Region>
-          <Region index="2">
-            <VarRegionAxis index="0">
-              <StartCoord value="0.36365"/>
-              <PeakCoord value="1.0"/>
-              <EndCoord value="1.0"/>
-            </VarRegionAxis>
-          </Region>
-        </VarRegionList>
-        <!-- VarDataCount=2 -->
-        <VarData index="0">
-          <!-- ItemCount=0 -->
-          <NumShorts value="0"/>
-          <!-- VarRegionCount=1 -->
-          <VarRegionIndex index="0" value="0"/>
-        </VarData>
-        <VarData index="1">
-          <!-- ItemCount=0 -->
-          <NumShorts value="0"/>
-          <!-- VarRegionCount=2 -->
-          <VarRegionIndex index="0" value="1"/>
-          <VarRegionIndex index="1" value="2"/>
-        </VarData>
-      </VarStore>
-    </CFFFont>
-
-    <GlobalSubrs>
-      <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
-    </GlobalSubrs>
-  </CFF2>
-
-  <GDEF>
-    <Version value="0x00010003"/>
-    <GlyphClassDef Format="1">
-      <ClassDef glyph="e" class="1"/>
-      <ClassDef glyph="uni0307" class="3"/>
-    </GlyphClassDef>
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=1 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=2 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=1 -->
-        <VarRegionIndex index="0" value="0"/>
-        <Item index="0" value="[1]"/>
-        <Item index="1" value="[88]"/>
-      </VarData>
-    </VarStore>
-  </GDEF>
-
-  <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="mark"/>
-        <Feature>
-          <!-- LookupCount=1 -->
-          <LookupListIndex index="0" value="0"/>
-        </Feature>
-      </FeatureRecord>
-    </FeatureList>
-    <LookupList>
-      <!-- LookupCount=1 -->
-      <Lookup index="0">
-        <LookupType value="4"/>
-        <LookupFlag value="0"/>
-        <!-- SubTableCount=1 -->
-        <MarkBasePos index="0" Format="1">
-          <MarkCoverage Format="1">
-            <Glyph value="uni0307"/>
-          </MarkCoverage>
-          <BaseCoverage Format="1">
-            <Glyph value="e"/>
-          </BaseCoverage>
-          <!-- ClassCount=1 -->
-          <MarkArray>
-            <!-- MarkCount=1 -->
-            <MarkRecord index="0">
-              <Class value="0"/>
-              <MarkAnchor Format="1">
-                <XCoordinate value="-2"/>
-                <YCoordinate value="465"/>
-              </MarkAnchor>
-            </MarkRecord>
-          </MarkArray>
-          <BaseArray>
-            <!-- BaseCount=1 -->
-            <BaseRecord index="0">
-              <BaseAnchor index="0" Format="3">
-                <XCoordinate value="314"/>
-                <YCoordinate value="556"/>
-                <XDeviceTable>
-                  <StartSize value="0"/>
-                  <EndSize value="0"/>
-                  <DeltaFormat value="32768"/>
-                </XDeviceTable>
-                <YDeviceTable>
-                  <StartSize value="0"/>
-                  <EndSize value="1"/>
-                  <DeltaFormat value="32768"/>
-                </YDeviceTable>
-              </BaseAnchor>
-            </BaseRecord>
-          </BaseArray>
-        </MarkBasePos>
-      </Lookup>
-    </LookupList>
-  </GPOS>
-
-  <GSUB>
-    <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="liga"/>
-        <Feature>
-          <!-- LookupCount=1 -->
-          <LookupListIndex index="0" value="0"/>
-        </Feature>
-      </FeatureRecord>
-    </FeatureList>
-    <LookupList>
-      <!-- LookupCount=1 -->
-      <Lookup index="0">
-        <LookupType value="4"/>
-        <LookupFlag value="0"/>
-        <!-- SubTableCount=1 -->
-        <LigatureSubst index="0" Format="1">
-          <LigatureSet glyph="a">
-            <Ligature components="e,s,s" glyph="s"/>
-          </LigatureSet>
-        </LigatureSubst>
-      </Lookup>
-    </LookupList>
-  </GSUB>
-
-  <HVAR>
-    <Version value="0x00010000"/>
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=3 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="0.36365"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-        <Region index="1">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.36365"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-        <Region index="2">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=1 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=0 -->
-        <Item index="0" value="[]"/>
-      </VarData>
-    </VarStore>
-    <AdvWidthMap>
-      <Map glyph=".notdef" outer="0" inner="0"/>
-      <Map glyph="a" outer="0" inner="0"/>
-      <Map glyph="e" outer="0" inner="0"/>
-      <Map glyph="edotaccent" outer="0" inner="0"/>
-      <Map glyph="s" outer="0" inner="0"/>
-      <Map glyph="uni0307" outer="0" inner="0"/>
-    </AdvWidthMap>
-  </HVAR>
-
-  <MVAR>
-    <Version value="0x00010000"/>
-    <Reserved value="0"/>
-    <ValueRecordSize value="8"/>
-    <!-- ValueRecordCount=1 -->
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=1 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=1 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=1 -->
-        <VarRegionIndex index="0" value="0"/>
-        <Item index="0" value="[-25]"/>
-      </VarData>
-    </VarStore>
-    <ValueRecord index="0">
-      <ValueTag value="undo"/>
-      <VarIdx value="0"/>
-    </ValueRecord>
-  </MVAR>
-
-  <STAT>
-    <Version value="0x00010001"/>
-    <DesignAxisRecordSize value="8"/>
-    <!-- DesignAxisCount=1 -->
-    <DesignAxisRecord>
-      <Axis index="0">
-        <AxisTag value="wght"/>
-        <AxisNameID value="256"/>  <!-- Weight -->
-        <AxisOrdering value="0"/>
-      </Axis>
-    </DesignAxisRecord>
-    <!-- AxisValueCount=0 -->
-    <ElidedFallbackNameID value="2"/>  <!-- Regular -->
-  </STAT>
-
-  <fvar>
-
-    <!-- Weight -->
-    <Axis>
-      <AxisTag>wght</AxisTag>
-      <Flags>0x0</Flags>
-      <MinValue>350.0</MinValue>
-      <DefaultValue>350.0</DefaultValue>
-      <MaxValue>625.0</MaxValue>
-      <AxisNameID>256</AxisNameID>
-    </Axis>
-  </fvar>
-
-</ttFont>
diff --git a/tests/data/TestVariableFont-TTF-post3.ttx b/tests/data/TestVariableFont-TTF-post3.ttx
deleted file mode 100644
index 86bb0e4..0000000
--- a/tests/data/TestVariableFont-TTF-post3.ttx
+++ /dev/null
@@ -1,666 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ttFont>
-
-  <GlyphOrder>
-    <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
-    <GlyphID id="0" name=".notdef"/>
-    <GlyphID id="1" name="a"/>
-    <GlyphID id="2" name="e"/>
-    <GlyphID id="3" name="s"/>
-    <GlyphID id="4" name="uni0307"/>
-    <GlyphID id="5" name="edotaccent"/>
-  </GlyphOrder>
-
-  <head>
-    <!-- Most of this table will be recalculated by the compiler -->
-    <tableVersion value="1.0"/>
-    <fontRevision value="0.0"/>
-    <checkSumAdjustment value="0x12345678"/>
-    <magicNumber value="0x5f0f3cf5"/>
-    <flags value="00000000 00000011"/>
-    <unitsPerEm value="1000"/>
-    <created value="Fri Feb 17 17:17:17 2017"/>
-    <modified value="Sun Feb 18 18:18:18 2018"/>
-    <xMin value="-37"/>
-    <yMin value="-250"/>
-    <xMax value="582"/>
-    <yMax value="750"/>
-    <macStyle value="00000000 00000000"/>
-    <lowestRecPPEM value="6"/>
-    <fontDirectionHint value="2"/>
-    <indexToLocFormat value="0"/>
-    <glyphDataFormat value="0"/>
-  </head>
-
-  <hhea>
-    <tableVersion value="0x00010000"/>
-    <ascent value="950"/>
-    <descent value="-250"/>
-    <lineGap value="0"/>
-    <advanceWidthMax value="600"/>
-    <minLeftSideBearing value="-37"/>
-    <minRightSideBearing value="-50"/>
-    <xMaxExtent value="582"/>
-    <caretSlopeRise value="1"/>
-    <caretSlopeRun value="0"/>
-    <caretOffset value="0"/>
-    <reserved0 value="0"/>
-    <reserved1 value="0"/>
-    <reserved2 value="0"/>
-    <reserved3 value="0"/>
-    <metricDataFormat value="0"/>
-    <numberOfHMetrics value="6"/>
-  </hhea>
-
-  <maxp>
-    <!-- Most of this table will be recalculated by the compiler -->
-    <tableVersion value="0x10000"/>
-    <numGlyphs value="6"/>
-    <maxPoints value="18"/>
-    <maxContours value="2"/>
-    <maxCompositePoints value="17"/>
-    <maxCompositeContours value="2"/>
-    <maxZones value="1"/>
-    <maxTwilightPoints value="0"/>
-    <maxStorage value="0"/>
-    <maxFunctionDefs value="0"/>
-    <maxInstructionDefs value="0"/>
-    <maxStackElements value="0"/>
-    <maxSizeOfInstructions value="0"/>
-    <maxComponentElements value="2"/>
-    <maxComponentDepth value="1"/>
-  </maxp>
-
-  <OS_2>
-    <!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
-         will be recalculated by the compiler -->
-    <version value="4"/>
-    <xAvgCharWidth value="580"/>
-    <usWeightClass value="350"/>
-    <usWidthClass value="5"/>
-    <fsType value="00000000 00000100"/>
-    <ySubscriptXSize value="650"/>
-    <ySubscriptYSize value="600"/>
-    <ySubscriptXOffset value="0"/>
-    <ySubscriptYOffset value="75"/>
-    <ySuperscriptXSize value="650"/>
-    <ySuperscriptYSize value="600"/>
-    <ySuperscriptXOffset value="0"/>
-    <ySuperscriptYOffset value="350"/>
-    <yStrikeoutSize value="50"/>
-    <yStrikeoutPosition value="300"/>
-    <sFamilyClass value="0"/>
-    <panose>
-      <bFamilyType value="0"/>
-      <bSerifStyle value="0"/>
-      <bWeight value="0"/>
-      <bProportion value="0"/>
-      <bContrast value="0"/>
-      <bStrokeVariation value="0"/>
-      <bArmStyle value="0"/>
-      <bLetterForm value="0"/>
-      <bMidline value="0"/>
-      <bXHeight value="0"/>
-    </panose>
-    <ulUnicodeRange1 value="00000000 00000000 00000000 01000101"/>
-    <ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
-    <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
-    <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
-    <achVendID value="NONE"/>
-    <fsSelection value="00000000 01000000"/>
-    <usFirstCharIndex value="97"/>
-    <usLastCharIndex value="775"/>
-    <sTypoAscender value="750"/>
-    <sTypoDescender value="-250"/>
-    <sTypoLineGap value="200"/>
-    <usWinAscent value="950"/>
-    <usWinDescent value="250"/>
-    <ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
-    <ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
-    <sxHeight value="500"/>
-    <sCapHeight value="700"/>
-    <usDefaultChar value="0"/>
-    <usBreakChar value="32"/>
-    <usMaxContext value="4"/>
-  </OS_2>
-
-  <hmtx>
-    <mtx name=".notdef" width="500" lsb="50"/>
-    <mtx name="a" width="600" lsb="9"/>
-    <mtx name="e" width="600" lsb="40"/>
-    <mtx name="edotaccent" width="600" lsb="40"/>
-    <mtx name="s" width="600" lsb="25"/>
-    <mtx name="uni0307" width="0" lsb="-37"/>
-  </hmtx>
-
-  <cmap>
-    <tableVersion version="0"/>
-    <cmap_format_4 platformID="0" platEncID="3" language="0">
-      <map code="0x61" name="a"/><!-- LATIN SMALL LETTER A -->
-      <map code="0x65" name="e"/><!-- LATIN SMALL LETTER E -->
-      <map code="0x73" name="s"/><!-- LATIN SMALL LETTER S -->
-      <map code="0x117" name="edotaccent"/><!-- LATIN SMALL LETTER E WITH DOT ABOVE -->
-      <map code="0x307" name="uni0307"/><!-- COMBINING DOT ABOVE -->
-    </cmap_format_4>
-    <cmap_format_4 platformID="3" platEncID="1" language="0">
-      <map code="0x61" name="a"/><!-- LATIN SMALL LETTER A -->
-      <map code="0x65" name="e"/><!-- LATIN SMALL LETTER E -->
-      <map code="0x73" name="s"/><!-- LATIN SMALL LETTER S -->
-      <map code="0x117" name="edotaccent"/><!-- LATIN SMALL LETTER E WITH DOT ABOVE -->
-      <map code="0x307" name="uni0307"/><!-- COMBINING DOT ABOVE -->
-    </cmap_format_4>
-  </cmap>
-
-  <loca>
-    <!-- The 'loca' table will be calculated by the compiler -->
-  </loca>
-
-  <glyf>
-
-    <!-- The xMin, yMin, xMax and yMax values
-         will be recalculated by the compiler. -->
-
-    <TTGlyph name=".notdef" xMin="50" yMin="-250" xMax="450" yMax="750">
-      <contour>
-        <pt x="50" y="-250" on="1"/>
-        <pt x="50" y="750" on="1"/>
-        <pt x="450" y="750" on="1"/>
-        <pt x="450" y="-250" on="1"/>
-      </contour>
-      <contour>
-        <pt x="100" y="-200" on="1"/>
-        <pt x="400" y="-200" on="1"/>
-        <pt x="400" y="700" on="1"/>
-        <pt x="100" y="700" on="1"/>
-      </contour>
-      <instructions/>
-    </TTGlyph>
-
-    <TTGlyph name="a" xMin="9" yMin="-12" xMax="468" yMax="504">
-      <contour>
-        <pt x="468" y="-1" on="1"/>
-        <pt x="366" y="-3" on="1"/>
-        <pt x="363" y="357" on="1"/>
-        <pt x="208" y="397" on="1"/>
-        <pt x="36" y="337" on="1"/>
-        <pt x="9" y="428" on="1"/>
-        <pt x="214" y="504" on="1"/>
-        <pt x="447" y="434" on="1"/>
-      </contour>
-      <contour>
-        <pt x="378" y="263" on="1"/>
-        <pt x="382" y="207" on="1"/>
-        <pt x="88" y="172" on="1"/>
-        <pt x="86" y="126" on="1"/>
-        <pt x="161" y="74" on="1"/>
-        <pt x="383" y="134" on="1"/>
-        <pt x="389" y="71" on="1"/>
-        <pt x="168" y="-12" on="1"/>
-        <pt x="29" y="22" on="1"/>
-        <pt x="26" y="240" on="1"/>
-      </contour>
-      <instructions/>
-    </TTGlyph>
-
-    <TTGlyph name="e" xMin="40" yMin="-18" xMax="576" yMax="513">
-      <contour>
-        <pt x="127" y="228" on="1"/>
-        <pt x="125" y="298" on="1"/>
-        <pt x="480" y="292" on="1"/>
-        <pt x="317" y="416" on="1"/>
-        <pt x="147" y="263" on="1"/>
-        <pt x="229" y="75" on="1"/>
-        <pt x="509" y="129" on="1"/>
-        <pt x="526" y="45" on="1"/>
-        <pt x="188" y="-18" on="1"/>
-        <pt x="40" y="261" on="1"/>
-        <pt x="316" y="513" on="1"/>
-        <pt x="571" y="305" on="1"/>
-        <pt x="576" y="226" on="1"/>
-      </contour>
-      <instructions/>
-    </TTGlyph>
-
-    <TTGlyph name="edotaccent" xMin="40" yMin="-18" xMax="576" yMax="693">
-      <component glyphName="e" x="0" y="0" flags="0x204"/>
-      <component glyphName="uni0307" x="313" y="96" flags="0x4"/>
-    </TTGlyph>
-
-    <TTGlyph name="s" xMin="25" yMin="-13" xMax="582" yMax="530">
-      <contour>
-        <pt x="559" y="459" on="1"/>
-        <pt x="539" y="376" on="1"/>
-        <pt x="326" y="442" on="1"/>
-        <pt x="213" y="366" on="1"/>
-        <pt x="582" y="174" on="1"/>
-        <pt x="304" y="-13" on="1"/>
-        <pt x="25" y="83" on="1"/>
-        <pt x="53" y="174" on="1"/>
-        <pt x="282" y="76" on="1"/>
-        <pt x="427" y="155" on="1"/>
-        <pt x="38" y="343" on="1"/>
-        <pt x="324" y="530" on="1"/>
-      </contour>
-      <instructions/>
-    </TTGlyph>
-
-    <TTGlyph name="uni0307" xMin="-37" yMin="501" xMax="50" yMax="597">
-      <contour>
-        <pt x="-21" y="597" on="1"/>
-        <pt x="50" y="589" on="1"/>
-        <pt x="41" y="501" on="1"/>
-        <pt x="-37" y="503" on="1"/>
-      </contour>
-      <instructions/>
-    </TTGlyph>
-
-  </glyf>
-
-  <name>
-    <namerecord nameID="256" platformID="1" platEncID="0" langID="0x0" unicode="True">
-      Weight
-    </namerecord>
-    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
-      Layer Font
-    </namerecord>
-    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
-      Regular
-    </namerecord>
-    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
-      0.000;NONE;LayerFont-Regular
-    </namerecord>
-    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
-      Layer Font Regular
-    </namerecord>
-    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
-      Version 0.000
-    </namerecord>
-    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
-      LayerFont-Regular
-    </namerecord>
-    <namerecord nameID="256" platformID="3" platEncID="1" langID="0x409">
-      Weight
-    </namerecord>
-  </name>
-
-  <post>
-    <formatType value="3.0"/>
-    <italicAngle value="0.0"/>
-    <underlinePosition value="-75"/>
-    <underlineThickness value="50"/>
-    <isFixedPitch value="0"/>
-    <minMemType42 value="0"/>
-    <maxMemType42 value="0"/>
-    <minMemType1 value="0"/>
-    <maxMemType1 value="0"/>
-  </post>
-
-  <GDEF>
-    <Version value="0x00010003"/>
-    <GlyphClassDef Format="1">
-      <ClassDef glyph="e" class="1"/>
-      <ClassDef glyph="uni0307" class="3"/>
-    </GlyphClassDef>
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=1 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=2 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=1 -->
-        <VarRegionIndex index="0" value="0"/>
-        <Item index="0" value="[1]"/>
-        <Item index="1" value="[88]"/>
-      </VarData>
-    </VarStore>
-  </GDEF>
-
-  <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="mark"/>
-        <Feature>
-          <!-- LookupCount=1 -->
-          <LookupListIndex index="0" value="0"/>
-        </Feature>
-      </FeatureRecord>
-    </FeatureList>
-    <LookupList>
-      <!-- LookupCount=1 -->
-      <Lookup index="0">
-        <LookupType value="4"/>
-        <LookupFlag value="0"/>
-        <!-- SubTableCount=1 -->
-        <MarkBasePos index="0" Format="1">
-          <MarkCoverage Format="1">
-            <Glyph value="uni0307"/>
-          </MarkCoverage>
-          <BaseCoverage Format="1">
-            <Glyph value="e"/>
-          </BaseCoverage>
-          <!-- ClassCount=1 -->
-          <MarkArray>
-            <!-- MarkCount=1 -->
-            <MarkRecord index="0">
-              <Class value="0"/>
-              <MarkAnchor Format="1">
-                <XCoordinate value="-2"/>
-                <YCoordinate value="465"/>
-              </MarkAnchor>
-            </MarkRecord>
-          </MarkArray>
-          <BaseArray>
-            <!-- BaseCount=1 -->
-            <BaseRecord index="0">
-              <BaseAnchor index="0" Format="3">
-                <XCoordinate value="314"/>
-                <YCoordinate value="556"/>
-                <XDeviceTable>
-                  <StartSize value="0"/>
-                  <EndSize value="0"/>
-                  <DeltaFormat value="32768"/>
-                </XDeviceTable>
-                <YDeviceTable>
-                  <StartSize value="0"/>
-                  <EndSize value="1"/>
-                  <DeltaFormat value="32768"/>
-                </YDeviceTable>
-              </BaseAnchor>
-            </BaseRecord>
-          </BaseArray>
-        </MarkBasePos>
-      </Lookup>
-    </LookupList>
-  </GPOS>
-
-  <GSUB>
-    <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="liga"/>
-        <Feature>
-          <!-- LookupCount=1 -->
-          <LookupListIndex index="0" value="0"/>
-        </Feature>
-      </FeatureRecord>
-    </FeatureList>
-    <LookupList>
-      <!-- LookupCount=1 -->
-      <Lookup index="0">
-        <LookupType value="4"/>
-        <LookupFlag value="0"/>
-        <!-- SubTableCount=1 -->
-        <LigatureSubst index="0" Format="1">
-          <LigatureSet glyph="a">
-            <Ligature components="e,s,s" glyph="s"/>
-          </LigatureSet>
-        </LigatureSubst>
-      </Lookup>
-    </LookupList>
-  </GSUB>
-
-  <HVAR>
-    <Version value="0x00010000"/>
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=3 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="0.36365"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-        <Region index="1">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.36365"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-        <Region index="2">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=1 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=0 -->
-        <Item index="0" value="[]"/>
-      </VarData>
-    </VarStore>
-    <AdvWidthMap>
-      <Map glyph=".notdef" outer="0" inner="0"/>
-      <Map glyph="a" outer="0" inner="0"/>
-      <Map glyph="e" outer="0" inner="0"/>
-      <Map glyph="edotaccent" outer="0" inner="0"/>
-      <Map glyph="s" outer="0" inner="0"/>
-      <Map glyph="uni0307" outer="0" inner="0"/>
-    </AdvWidthMap>
-  </HVAR>
-
-  <MVAR>
-    <Version value="0x00010000"/>
-    <Reserved value="0"/>
-    <ValueRecordSize value="8"/>
-    <!-- ValueRecordCount=1 -->
-    <VarStore Format="1">
-      <Format value="1"/>
-      <VarRegionList>
-        <!-- RegionAxisCount=1 -->
-        <!-- RegionCount=1 -->
-        <Region index="0">
-          <VarRegionAxis index="0">
-            <StartCoord value="0.0"/>
-            <PeakCoord value="1.0"/>
-            <EndCoord value="1.0"/>
-          </VarRegionAxis>
-        </Region>
-      </VarRegionList>
-      <!-- VarDataCount=1 -->
-      <VarData index="0">
-        <!-- ItemCount=1 -->
-        <NumShorts value="0"/>
-        <!-- VarRegionCount=1 -->
-        <VarRegionIndex index="0" value="0"/>
-        <Item index="0" value="[-25]"/>
-      </VarData>
-    </VarStore>
-    <ValueRecord index="0">
-      <ValueTag value="undo"/>
-      <VarIdx value="0"/>
-    </ValueRecord>
-  </MVAR>
-
-  <STAT>
-    <Version value="0x00010001"/>
-    <DesignAxisRecordSize value="8"/>
-    <!-- DesignAxisCount=1 -->
-    <DesignAxisRecord>
-      <Axis index="0">
-        <AxisTag value="wght"/>
-        <AxisNameID value="256"/>  <!-- Weight -->
-        <AxisOrdering value="0"/>
-      </Axis>
-    </DesignAxisRecord>
-    <!-- AxisValueCount=0 -->
-    <ElidedFallbackNameID value="2"/>  <!-- Regular -->
-  </STAT>
-
-  <fvar>
-
-    <!-- Weight -->
-    <Axis>
-      <AxisTag>wght</AxisTag>
-      <Flags>0x0</Flags>
-      <MinValue>350.0</MinValue>
-      <DefaultValue>350.0</DefaultValue>
-      <MaxValue>625.0</MaxValue>
-      <AxisNameID>256</AxisNameID>
-    </Axis>
-  </fvar>
-
-  <gvar>
-    <version value="1"/>
-    <reserved value="0"/>
-    <glyphVariations glyph="a">
-      <tuple>
-        <coord axis="wght" value="1.0"/>
-        <delta pt="0" x="0" y="0"/>
-        <delta pt="1" x="-59" y="2"/>
-        <delta pt="2" x="-59" y="-54"/>
-        <delta pt="3" x="0" y="-56"/>
-        <delta pt="4" x="0" y="-56"/>
-        <delta pt="5" x="0" y="0"/>
-        <delta pt="6" x="0" y="0"/>
-        <delta pt="7" x="0" y="0"/>
-        <delta pt="8" x="0" y="0"/>
-        <delta pt="9" x="-1" y="-23"/>
-        <delta pt="10" x="77" y="7"/>
-        <delta pt="11" x="77" y="7"/>
-        <delta pt="12" x="40" y="28"/>
-        <delta pt="13" x="0" y="15"/>
-        <delta pt="14" x="0" y="0"/>
-        <delta pt="15" x="0" y="0"/>
-        <delta pt="16" x="0" y="0"/>
-        <delta pt="17" x="0" y="0"/>
-        <delta pt="18" x="0" y="0"/>
-        <delta pt="19" x="0" y="0"/>
-        <delta pt="20" x="0" y="0"/>
-        <delta pt="21" x="0" y="0"/>
-      </tuple>
-    </glyphVariations>
-    <glyphVariations glyph="e">
-      <tuple>
-        <coord axis="wght" min="0.0" value="0.36365" max="1.0"/>
-        <delta pt="0" x="-1" y="-25"/>
-        <delta pt="1" x="0" y="0"/>
-        <delta pt="2" x="-84" y="5"/>
-        <delta pt="3" x="1" y="-29"/>
-        <delta pt="4" x="33" y="1"/>
-        <delta pt="5" x="35" y="41"/>
-        <delta pt="6" x="-2" y="28"/>
-        <delta pt="7" x="0" y="0"/>
-        <delta pt="8" x="0" y="0"/>
-        <delta pt="9" x="0" y="0"/>
-        <delta pt="10" x="0" y="0"/>
-        <delta pt="11" x="0" y="0"/>
-        <delta pt="12" x="0" y="-27"/>
-        <delta pt="13" x="0" y="0"/>
-        <delta pt="14" x="0" y="0"/>
-        <delta pt="15" x="0" y="0"/>
-        <delta pt="16" x="0" y="0"/>
-      </tuple>
-      <tuple>
-        <coord axis="wght" min="0.36365" value="1.0" max="1.0"/>
-        <delta pt="0" x="70" y="1"/>
-        <delta pt="1" x="70" y="1"/>
-        <delta pt="2" x="-76" y="1"/>
-        <delta pt="3" x="-16" y="-56"/>
-        <delta pt="4" x="70" y="1"/>
-        <delta pt="5" x="15" y="55"/>
-        <delta pt="6" x="15" y="55"/>
-        <delta pt="7" x="2" y="-45"/>
-        <delta pt="8" x="0" y="0"/>
-        <delta pt="9" x="-31" y="1"/>
-        <delta pt="10" x="-2" y="35"/>
-        <delta pt="11" x="25" y="-1"/>
-        <delta pt="12" x="25" y="-1"/>
-        <delta pt="13" x="0" y="0"/>
-        <delta pt="14" x="0" y="0"/>
-        <delta pt="15" x="0" y="0"/>
-        <delta pt="16" x="0" y="0"/>
-      </tuple>
-    </glyphVariations>
-    <glyphVariations glyph="edotaccent">
-      <tuple>
-        <coord axis="wght" value="1.0"/>
-        <delta pt="1" x="-6" y="91"/>
-      </tuple>
-    </glyphVariations>
-    <glyphVariations glyph="s">
-      <tuple>
-        <coord axis="wght" value="1.0"/>
-        <delta pt="0" x="0" y="0"/>
-        <delta pt="1" x="-2" y="-40"/>
-        <delta pt="2" x="-2" y="-40"/>
-        <delta pt="3" x="55" y="-9"/>
-        <delta pt="4" x="26" y="-33"/>
-        <delta pt="5" x="-20" y="-45"/>
-        <delta pt="6" x="-18" y="-4"/>
-        <delta pt="7" x="-27" y="52"/>
-        <delta pt="8" x="-61" y="43"/>
-        <delta pt="9" x="-80" y="-6"/>
-        <delta pt="10" x="-22" y="55"/>
-        <delta pt="11" x="0" y="0"/>
-        <delta pt="12" x="0" y="0"/>
-        <delta pt="13" x="0" y="0"/>
-        <delta pt="14" x="0" y="0"/>
-        <delta pt="15" x="0" y="0"/>
-      </tuple>
-    </glyphVariations>
-    <glyphVariations glyph="uni0307">
-      <tuple>
-        <coord axis="wght" value="1.0"/>
-        <delta pt="0" x="-8" y="28"/>
-        <delta pt="1" x="13" y="16"/>
-        <delta pt="2" x="17" y="-13"/>
-        <delta pt="3" x="-27" y="-20"/>
-        <delta pt="4" x="0" y="0"/>
-        <delta pt="5" x="0" y="0"/>
-        <delta pt="6" x="0" y="0"/>
-        <delta pt="7" x="0" y="0"/>
-      </tuple>
-    </glyphVariations>
-  </gvar>
-
-</ttFont>
diff --git a/tests/featureWriters/kernFeatureWriter_test.py b/tests/featureWriters/kernFeatureWriter_test.py
index 6ac6975..cd91ee2 100644
--- a/tests/featureWriters/kernFeatureWriter_test.py
+++ b/tests/featureWriters/kernFeatureWriter_test.py
@@ -3,6 +3,7 @@ from textwrap import dedent
 
 import pytest
 
+from ufo2ft.errors import InvalidFeaturesData
 from ufo2ft.featureCompiler import parseLayoutFeatures
 from ufo2ft.featureWriters import KernFeatureWriter, ast
 
@@ -224,6 +225,164 @@ class KernFeatureWriterTest(FeatureWriterTest):
 
         assert str(feaFile) == existing
 
+    def test_insert_comment_before(self, FontClass):
+        ufo = FontClass()
+        for name in ("one", "four", "six", "seven"):
+            ufo.newGlyph(name)
+        existing = dedent(
+            """\
+            feature kern {
+                #
+                # Automatic Code
+                #
+                pos one four' -50 six;
+            } kern;
+            """
+        )
+        ufo.features.text = existing
+        ufo.kerning.update({("seven", "six"): 25.0})
+
+        writer = KernFeatureWriter()
+        feaFile = parseLayoutFeatures(ufo)
+        assert writer.write(ufo, feaFile)
+
+        expected = dedent(
+            """\
+            lookup kern_ltr {
+                lookupflag IgnoreMarks;
+                pos seven six 25;
+            } kern_ltr;
+
+            feature kern {
+                lookup kern_ltr;
+            } kern;
+
+            feature kern {
+                #
+                #
+                pos one four' -50 six;
+            } kern;
+            """
+        )
+
+        assert str(feaFile).strip() == expected.strip()
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(ufo, mode="append")
+        assert str(generated) == dedent(
+            """
+            lookup kern_ltr {
+                lookupflag IgnoreMarks;
+                pos seven six 25;
+            } kern_ltr;
+
+            feature kern {
+                lookup kern_ltr;
+            } kern;
+            """
+        )
+
+    def test_insert_comment_after(self, FontClass):
+        ufo = FontClass()
+        for name in ("one", "four", "six", "seven"):
+            ufo.newGlyph(name)
+        existing = dedent(
+            """\
+            feature kern {
+                pos one four' -50 six;
+                #
+                # Automatic Code
+                #
+            } kern;
+            """
+        )
+        ufo.features.text = existing
+        ufo.kerning.update({("seven", "six"): 25.0})
+
+        writer = KernFeatureWriter()
+        feaFile = parseLayoutFeatures(ufo)
+        assert writer.write(ufo, feaFile)
+
+        expected = dedent(
+            """\
+            feature kern {
+                pos one four' -50 six;
+                #
+                #
+            } kern;
+
+
+            lookup kern_ltr {
+                lookupflag IgnoreMarks;
+                pos seven six 25;
+            } kern_ltr;
+
+            feature kern {
+                lookup kern_ltr;
+            } kern;
+            """
+        )
+
+        assert str(feaFile) == expected
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(ufo, mode="append")
+        assert str(generated) == dedent(
+            """
+            lookup kern_ltr {
+                lookupflag IgnoreMarks;
+                pos seven six 25;
+            } kern_ltr;
+
+            feature kern {
+                lookup kern_ltr;
+            } kern;
+            """
+        )
+
+    def test_insert_comment_middle(self, FontClass):
+        ufo = FontClass()
+        for name in ("one", "four", "six", "seven"):
+            ufo.newGlyph(name)
+        existing = dedent(
+            """\
+            feature kern {
+                pos one four' -50 six;
+                #
+                # Automatic Code
+                #
+                pos one six' -50 six;
+            } kern;
+            """
+        )
+        ufo.features.text = existing
+        ufo.kerning.update({("seven", "six"): 25.0})
+
+        writer = KernFeatureWriter()
+        feaFile = parseLayoutFeatures(ufo)
+
+        with pytest.raises(
+            InvalidFeaturesData,
+            match="Insert marker has rules before and after, feature kern "
+            "cannot be inserted.",
+        ):
+            writer.write(ufo, feaFile)
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(ufo, mode="append")
+        assert str(generated) == dedent(
+            """
+            lookup kern_ltr {
+                lookupflag IgnoreMarks;
+                pos seven six 25;
+            } kern_ltr;
+
+            feature kern {
+                lookup kern_ltr;
+            } kern;
+            """
+        )
+
     def test_arabic_numerals(self, FontClass):
         """Test that arabic numerals (with bidi type AN) are kerned LTR.
         https://github.com/googlei18n/ufo2ft/issues/198
diff --git a/tests/featureWriters/markFeatureWriter_test.py b/tests/featureWriters/markFeatureWriter_test.py
index cbff2b4..c977be8 100644
--- a/tests/featureWriters/markFeatureWriter_test.py
+++ b/tests/featureWriters/markFeatureWriter_test.py
@@ -4,6 +4,7 @@ from textwrap import dedent
 
 import pytest
 
+from ufo2ft.errors import InvalidFeaturesData
 from ufo2ft.featureCompiler import parseLayoutFeatures
 from ufo2ft.featureWriters import ast
 from ufo2ft.featureWriters.markFeatureWriter import (
@@ -252,6 +253,267 @@ class MarkFeatureWriterTest(FeatureWriterTest):
             """
         )
 
+    def test_insert_comment_before(self, testufo):
+        writer = MarkFeatureWriter()
+        testufo.features.text = dedent(
+            """\
+            markClass acutecomb <anchor 100 200> @MC_top;
+            feature mark {
+                #
+                # Automatic Code
+                #
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+            } mark;
+            """
+        )
+        feaFile = parseLayoutFeatures(testufo)
+
+        assert writer.write(testufo, feaFile)
+
+        assert str(feaFile) == dedent(
+            """\
+            markClass acutecomb <anchor 100 200> @MC_top;
+            markClass tildecomb <anchor 100 200> @MC_top;
+
+            feature mark {
+                lookup mark2base {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark2base;
+
+                lookup mark2liga {
+                    pos ligature f_i <anchor 100 500> mark @MC_top
+                        ligComponent <anchor 600 500> mark @MC_top;
+                } mark2liga;
+
+            } mark;
+
+            feature mark {
+                #
+                #
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+
+            } mark;
+
+            feature mkmk {
+                lookup mark2mark_top {
+                    @MFS_mark2mark_top = [acutecomb tildecomb];
+                    lookupflag UseMarkFilteringSet @MFS_mark2mark_top;
+                    pos mark tildecomb <anchor 100 300> mark @MC_top;
+                } mark2mark_top;
+
+            } mkmk;
+            """
+        )
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(testufo, mode="append")
+        assert str(generated) == dedent(
+            """\
+            markClass tildecomb <anchor 100 200> @MC_top;
+
+            feature mark {
+                lookup mark2base {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark2base;
+
+                lookup mark2liga {
+                    pos ligature f_i <anchor 100 500> mark @MC_top
+                        ligComponent <anchor 600 500> mark @MC_top;
+                } mark2liga;
+
+            } mark;
+
+            feature mkmk {
+                lookup mark2mark_top {
+                    @MFS_mark2mark_top = [acutecomb tildecomb];
+                    lookupflag UseMarkFilteringSet @MFS_mark2mark_top;
+                    pos mark tildecomb <anchor 100 300> mark @MC_top;
+                } mark2mark_top;
+
+            } mkmk;
+            """
+        )
+
+    def test_insert_comment_after(self, testufo):
+        writer = MarkFeatureWriter()
+        testufo.features.text = dedent(
+            """\
+            markClass acutecomb <anchor 100 200> @MC_top;
+            feature mark {
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+                #
+                # Automatic Code
+                #
+            } mark;
+            """
+        )
+        feaFile = parseLayoutFeatures(testufo)
+
+        assert writer.write(testufo, feaFile)
+
+        assert str(feaFile) == dedent(
+            """\
+            markClass acutecomb <anchor 100 200> @MC_top;
+            feature mark {
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+
+                #
+                #
+            } mark;
+
+            markClass tildecomb <anchor 100 200> @MC_top;
+
+            feature mark {
+                lookup mark2base {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark2base;
+
+                lookup mark2liga {
+                    pos ligature f_i <anchor 100 500> mark @MC_top
+                        ligComponent <anchor 600 500> mark @MC_top;
+                } mark2liga;
+
+            } mark;
+
+            feature mkmk {
+                lookup mark2mark_top {
+                    @MFS_mark2mark_top = [acutecomb tildecomb];
+                    lookupflag UseMarkFilteringSet @MFS_mark2mark_top;
+                    pos mark tildecomb <anchor 100 300> mark @MC_top;
+                } mark2mark_top;
+
+            } mkmk;
+            """
+        )
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(testufo, mode="append")
+        assert str(generated) == dedent(
+            """\
+            markClass tildecomb <anchor 100 200> @MC_top;
+
+            feature mark {
+                lookup mark2base {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark2base;
+
+                lookup mark2liga {
+                    pos ligature f_i <anchor 100 500> mark @MC_top
+                        ligComponent <anchor 600 500> mark @MC_top;
+                } mark2liga;
+
+            } mark;
+
+            feature mkmk {
+                lookup mark2mark_top {
+                    @MFS_mark2mark_top = [acutecomb tildecomb];
+                    lookupflag UseMarkFilteringSet @MFS_mark2mark_top;
+                    pos mark tildecomb <anchor 100 300> mark @MC_top;
+                } mark2mark_top;
+
+            } mkmk;
+            """
+        )
+
+    def test_insert_comment_middle(self, testufo):
+        writer = MarkFeatureWriter()
+        testufo.features.text = dedent(
+            """\
+            markClass acutecomb <anchor 100 200> @MC_top;
+            feature mark {
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+                #
+                # Automatic Code
+                #
+                lookup mark2 {
+                    pos base a <anchor 150 250> mark @MC_top;
+                } mark2;
+            } mark;
+            """
+        )
+        feaFile = parseLayoutFeatures(testufo)
+
+        with pytest.raises(
+            InvalidFeaturesData,
+            match="Insert marker has rules before and after, feature mark "
+            "cannot be inserted.",
+        ):
+            writer.write(testufo, feaFile)
+
+        # test append mode ignores insert marker
+        generated = self.writeFeatures(testufo, mode="append")
+        assert str(generated) == dedent(
+            """\
+            markClass tildecomb <anchor 100 200> @MC_top;
+
+            feature mark {
+                lookup mark2base {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark2base;
+
+                lookup mark2liga {
+                    pos ligature f_i <anchor 100 500> mark @MC_top
+                        ligComponent <anchor 600 500> mark @MC_top;
+                } mark2liga;
+
+            } mark;
+
+            feature mkmk {
+                lookup mark2mark_top {
+                    @MFS_mark2mark_top = [acutecomb tildecomb];
+                    lookupflag UseMarkFilteringSet @MFS_mark2mark_top;
+                    pos mark tildecomb <anchor 100 300> mark @MC_top;
+                } mark2mark_top;
+
+            } mkmk;
+            """
+        )
+
+    def test_insert_comment_outside_block(self, testufo):
+        writer = MarkFeatureWriter()
+        testufo.features.text = dedent(
+            """\
+            #
+            # Automatic Code
+            #
+            """
+        )
+        feaFile = parseLayoutFeatures(testufo)
+
+        assert writer.write(testufo, feaFile)
+
+        testufo.features.text = dedent(
+            """\
+            #
+            # Automatic Code
+            #
+            markClass acutecomb <anchor 100 200> @MC_top;
+            feature mark {
+                lookup mark1 {
+                    pos base a <anchor 100 200> mark @MC_top;
+                } mark1;
+
+            } mark;
+            """
+        )
+        feaFile = parseLayoutFeatures(testufo)
+
+        assert writer.write(testufo, feaFile)
+
+        # test append mode
+        writer = MarkFeatureWriter(mode="append")
+        assert writer.write(testufo, feaFile)
+
     def test_mark_mkmk_features(self, testufo):
         writer = MarkFeatureWriter()  # by default both mark + mkmk are built
         feaFile = ast.FeatureFile()
diff --git a/tests/integration_test.py b/tests/integration_test.py
index e56699e..87dcef6 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -12,7 +12,6 @@ from ufo2ft import (
     compileVariableCFF2,
     compileVariableTTF,
 )
-from ufo2ft.constants import KEEP_GLYPH_NAMES
 
 
 def getpath(filename):
@@ -167,8 +166,8 @@ class IntegrationTest:
         "subroutinizer, cff_version, expected_ttx",
         [
             (None, 1, "TestFont-CFF.ttx"),
-            ("compreffor", 1, "TestFont-CFF-compreffor.ttx"),
-            ("cffsubr", 1, "TestFont-CFF.ttx"),
+            ("compreffor", 1, "TestFont-CFF.ttx"),
+            ("cffsubr", 1, "TestFont-CFF-cffsubr.ttx"),
             (None, 2, "TestFont-CFF2-cffsubr.ttx"),
             # ("compreffor", 2, "TestFont-CFF2-compreffor.ttx"),
             ("cffsubr", 2, "TestFont-CFF2-cffsubr.ttx"),
@@ -230,27 +229,13 @@ class IntegrationTest:
         ],
     )
     def test_drop_glyph_names(self, testufo, output_format, options, expected_ttx):
+        from ufo2ft.constants import KEEP_GLYPH_NAMES
+
         testufo.lib[KEEP_GLYPH_NAMES] = False
         compile_func = globals()[f"compile{output_format}"]
         ttf = compile_func(testufo, **options)
         expectTTX(ttf, expected_ttx)
 
-    @pytest.mark.parametrize(
-        "output_format, options, expected_ttx",
-        [
-            ("VariableTTF", {}, "TestVariableFont-TTF-post3.ttx"),
-            ("VariableCFF2", {}, "TestVariableFont-CFF2-post3.ttx"),
-        ],
-    )
-    def test_drop_glyph_names_variable(
-        self, designspace, output_format, options, expected_ttx
-    ):
-        # set keepGlyphNames in the default UFO.lib where postProcessor finds it
-        designspace.findDefault().font.lib[KEEP_GLYPH_NAMES] = False
-        compile_func = globals()[f"compile{output_format}"]
-        ttf = compile_func(designspace, **options)
-        expectTTX(ttf, expected_ttx)
-
 
 if __name__ == "__main__":
     sys.exit(pytest.main(sys.argv))