[cantarell-fonts] Update deps



commit f64d4fd8dafb4f73ab2837ba7e5c27153bb94a87
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Sun Dec 20 21:02:44 2020 +0000

    Update deps

 requirements-dev.txt    | 33 ++++++++++++++++-----------------
 requirements.txt        | 21 ++++++++++-----------
 scripts/instantiator.py | 33 ++++++++++++++++++++++++++++-----
 3 files changed, 54 insertions(+), 33 deletions(-)
---
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 9c6b9e74..66480321 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -6,35 +6,34 @@
 #
 appdirs==1.4.4            # via -r requirements.txt, fs
 astroid==2.4.2            # via pylint
-attrs==19.3.0             # via -r requirements.txt, cattrs, statmake, ufolib2
+attrs==20.3.0             # via -r requirements.txt, cattrs, statmake, ufolib2
 booleanoperations==0.9.0  # via -r requirements.txt, ufo2ft
-cattrs==1.0.0             # via -r requirements.txt, statmake
+cattrs==1.1.2             # via -r requirements.txt, statmake
 cffsubr==0.2.7            # via -r requirements.txt, ufo2ft
 compreffor==0.5.0         # via -r requirements.txt, ufo2ft
 cu2qu==1.6.7              # via -r requirements.txt, ufo2ft
 fontmath==0.6.0           # via -r requirements.txt
-fonttools[lxml,ufo,unicode]==4.12.0  # via -r requirements.txt, booleanoperations, cffsubr, compreffor, 
cu2qu, fontmath, glyphslib, psautohint, statmake, ufo2ft, ufolib2
+fonttools[lxml,ufo,unicode]==4.18.2  # via -r requirements.txt, booleanoperations, cffsubr, compreffor, 
cu2qu, fontmath, glyphslib, psautohint, statmake, ufo2ft, ufolib2
 fs==2.4.11                # via -r requirements.txt, fonttools
-glyphslib==5.1.10         # via -r requirements-dev.in
-isort==4.3.21             # via pylint
+glyphslib==5.3.0          # via -r requirements-dev.in
+isort==5.6.4              # via pylint
 lazy-object-proxy==1.4.3  # via astroid
-lxml==4.5.1               # via -r requirements.txt, fonttools
+lxml==4.6.2               # via -r requirements.txt, fonttools
 mccabe==0.6.1             # via pylint
 mypy-extensions==0.4.3    # via mypy
-mypy==0.780               # via -r requirements-dev.in
-psautohint==2.0.1         # via -r requirements.txt
-pyclipper==1.1.0.post3    # via -r requirements.txt, booleanoperations
-pylint==2.5.3             # via -r requirements-dev.in
-pytz==2020.1              # via -r requirements.txt, fs
+mypy==0.790               # via -r requirements-dev.in
+psautohint==2.2.0         # via -r requirements.txt
+pyclipper==1.2.0          # via -r requirements.txt, booleanoperations
+pylint==2.6.0             # via -r requirements-dev.in
+pytz==2020.4              # via -r requirements.txt, fs
 six==1.15.0               # via -r requirements.txt, astroid, fs
-skia-pathops==0.4.1       # via -r requirements.txt
+skia-pathops==0.6.0       # via -r requirements.txt
 statmake==0.3.0           # via -r requirements.txt
-toml==0.10.1              # via pylint
+toml==0.10.2              # via pylint
 typed-ast==1.4.1          # via mypy
-typing-extensions==3.7.4.2  # via mypy
-ufo2ft[cffsubr]==2.15.0   # via -r requirements.txt
-ufolib2==0.8.0            # via -r requirements.txt, glyphslib
-unicodedata2==13.0.0.post2  # via -r requirements.txt, fonttools
+typing-extensions==3.7.4.3  # via mypy
+ufo2ft[cffsubr]==2.19.1   # via -r requirements.txt
+ufolib2==0.10.1           # via -r requirements.txt, glyphslib
 wrapt==1.12.1             # via astroid
 
 # The following packages are considered to be unsafe in a requirements file:
diff --git a/requirements.txt b/requirements.txt
index 070370f5..3b028717 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,25 +5,24 @@
 #    pip-compile --output-file=requirements.txt requirements.in
 #
 appdirs==1.4.4            # via fs
-attrs==19.3.0             # via -r requirements.in, cattrs, statmake, ufolib2
+attrs==20.3.0             # via -r requirements.in, cattrs, statmake, ufolib2
 booleanoperations==0.9.0  # via ufo2ft
-cattrs==1.0.0             # via statmake
+cattrs==1.1.2             # via statmake
 cffsubr==0.2.7            # via ufo2ft
 compreffor==0.5.0         # via ufo2ft
 cu2qu==1.6.7              # via ufo2ft
 fontmath==0.6.0           # via -r requirements.in
-fonttools[lxml,ufo,unicode]==4.12.0  # via -r requirements.in, booleanoperations, cffsubr, compreffor, 
cu2qu, fontmath, psautohint, statmake, ufo2ft, ufolib2
+fonttools[lxml,ufo,unicode]==4.18.2  # via -r requirements.in, booleanoperations, cffsubr, compreffor, 
cu2qu, fontmath, psautohint, statmake, ufo2ft, ufolib2
 fs==2.4.11                # via fonttools
-lxml==4.5.1               # via fonttools
-psautohint==2.0.1         # via -r requirements.in
-pyclipper==1.1.0.post3    # via booleanoperations
-pytz==2020.1              # via fs
+lxml==4.6.2               # via fonttools
+psautohint==2.2.0         # via -r requirements.in
+pyclipper==1.2.0          # via booleanoperations
+pytz==2020.4              # via fs
 six==1.15.0               # via fs
-skia-pathops==0.4.1       # via -r requirements.in
+skia-pathops==0.6.0       # via -r requirements.in
 statmake==0.3.0           # via -r requirements.in
-ufo2ft[cffsubr]==2.15.0   # via -r requirements.in
-ufolib2==0.8.0            # via -r requirements.in
-unicodedata2==13.0.0.post2  # via fonttools
+ufo2ft[cffsubr]==2.19.1   # via -r requirements.in
+ufolib2==0.10.1           # via -r requirements.in
 
 # The following packages are considered to be unsafe in a requirements file:
 # setuptools
diff --git a/scripts/instantiator.py b/scripts/instantiator.py
index d533073a..1e2e0d74 100644
--- a/scripts/instantiator.py
+++ b/scripts/instantiator.py
@@ -42,6 +42,7 @@ import fontTools.designspaceLib as designspaceLib
 import fontTools.misc.fixedTools
 import fontTools.varLib as varLib
 import ufoLib2
+import ufoLib2.objects
 
 logger = logging.getLogger(__name__)
 
@@ -153,6 +154,26 @@ class InstantiatorError(Exception):
     pass
 
 
+def process_rules_swaps(rules, location, glyphNames):
+    """Apply these rules at this location to these glyphnames
+    - rule order matters
+
+    Return a list of (oldName, newName) in the same order as the rules.
+    """
+    swaps = []
+    glyphNames = set(glyphNames)
+    for rule in rules:
+        if designspaceLib.evaluateRule(rule, location):
+            for oldName, newName in rule.subs:
+                # Here I don't check if the new name is also in glyphNames...
+                # I guess it should be, so that we can swap, and if it isn't,
+                # then it's better to error out later when we try to swap,
+                # instead of silently ignoring the rule here.
+                if oldName in glyphNames:
+                    swaps.append((oldName, newName))
+    return swaps
+
+
 @attr.s(auto_attribs=True, frozen=True, slots=True)
 class Instantiator:
     """Data class that holds all necessary information to generate a static
@@ -375,10 +396,10 @@ class Instantiator:
 
         # Process rules
         glyph_names_list = self.glyph_mutators.keys()
-        glyph_names_list_renamed = designspaceLib.processRules(
-            self.designspace_rules, location, glyph_names_list
-        )
-        for name_old, name_new in zip(glyph_names_list, glyph_names_list_renamed):
+        # The order of the swaps below is independent of the order of glyph names.
+        # It depends on the order of the <sub>s in the designspace rules.
+        swaps = process_rules_swaps(self.designspace_rules, location, glyph_names_list)
+        for name_old, name_new in swaps:
             if name_old != name_new:
                 swap_glyph_names(font, name_old, name_new)
 
@@ -581,7 +602,9 @@ def collect_glyph_masters(
     # Filter out empty glyphs if the default glyph is not empty.
     if not default_glyph_empty and other_glyph_empty:
         locations_and_masters = [
-            (l, m) for l, m in locations_and_masters if m.contours or m.components
+            (loc, master)
+            for loc, master in locations_and_masters
+            if master.contours or master.components
         ]
 
     return locations_and_masters


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]