Browse Source

Remove alias and combAccentOnly flags for mark pos

The alias flags were used to apply mark positioning to a composite
glyph based on its components. But we can achieve the same effect by
simply making sure the anchors for those composite glyphs are copied
from their components.

We do this by adding the aliased glyphs' unicode values to a set which
filters the composite glyphs to which anchors are copied. I'm not sure
why this filter exists in the first place, but for now I'm keeping it
in to be safe.

The combAccentOnly flags were used to apply mark-to-base attachments
only for accent glyphs with width of zero. This was unnecessary
because no nonzero-width-glyph contains any of the mark anchors for
which the flag was applied.
James Godfrey-Kittle 8 years ago
parent
commit
4a86e57b5d
2 changed files with 15 additions and 19 deletions
  1. 5 3
      scripts/lib/fontbuild/generateGlyph.py
  2. 10 16
      scripts/lib/fontbuild/markFeature.py

+ 5 - 3
scripts/lib/fontbuild/generateGlyph.py

@@ -33,9 +33,11 @@ def parseComposite(composite):
 
 
 def copyMarkAnchors(f, g, srcname, width):
-    unicode_range = range(0x0030, 0x02B0) + range(0x1E00, 0x1EFF)
-    anchors = f[srcname].anchors
-    for anchor in anchors:
+    unicode_range = set(
+        range(0x0030, 0x02B0) + range(0x1E00, 0x1EFF) +
+        [0x430, 0x435, 0x440, 0x441, 0x445, 0x455, 0x456, 0x471])
+
+    for anchor in f[srcname].anchors:
         if "top_dd" == anchor.name:
             g.appendAnchor(anchor.name, (anchor.x + width, anchor.y))
         if "bottom_dd" == anchor.name:

+ 10 - 16
scripts/lib/fontbuild/markFeature.py

@@ -23,16 +23,16 @@ class RobotoFeatureCompiler(FeatureOTFCompiler):
 
     def setupAnchorPairs(self):
         self.anchorPairs = [
-            ["top", "_marktop", True, True],
-            ["bottom", "_markbottom", True, True],
-            ["top_dd", "_marktop_dd", True, False],
-            ["bottom_dd", "_markbottom_dd", True, False],
-            ["rhotichook", "_markrhotichook", False, False],
-            ["top0315", "_marktop0315", False, False],
-            ["parent_top", "_markparent_top", False, False],
-            ["parenthesses.w1", "_markparenthesses.w1", False, False],
-            ["parenthesses.w2", "_markparenthesses.w2", False, False],
-            ["parenthesses.w3", "_markparenthesses.w3", False, False]]
+            ["top", "_marktop"],
+            ["bottom", "_markbottom"],
+            ["top_dd", "_marktop_dd"],
+            ["bottom_dd", "_markbottom_dd"],
+            ["rhotichook", "_markrhotichook"],
+            ["top0315", "_marktop0315"],
+            ["parent_top", "_markparent_top"],
+            ["parenthesses.w1", "_markparenthesses.w1"],
+            ["parenthesses.w2", "_markparenthesses.w2"],
+            ["parenthesses.w3", "_markparenthesses.w3"]]
 
         self.mkmkAnchorPairs = [
             ["mkmktop", "_marktop"],
@@ -40,12 +40,6 @@ class RobotoFeatureCompiler(FeatureOTFCompiler):
 
         self.ligaAnchorPairs = []
 
-    def setupAliases(self):
-        self.aliases = [
-            ["a", "uni0430"], ["e", "uni0435"], ["p", "uni0440"],
-            ["c", "uni0441"], ["x", "uni0445"], ["s", "uni0455"],
-            ["i", "uni0456"], ["psi", "uni0471"]]
-
 
 class RobotoKernWriter(KernFeatureWriter):
     leftFeaClassRe = r"@_(.+)_L$"