[cantarell-fonts/ufo-conversion] Use otRound for making instances



commit 82ed9cb8e2e4b2662e69e93118c9e48e7a741e4e
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Mon Mar 25 21:31:00 2019 +0000

    Use otRound for making instances

 scripts/instantiator.py      | 3 +++
 scripts/make-static-fonts.py | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/scripts/instantiator.py b/scripts/instantiator.py
index 0dc65e08..c2efd743 100644
--- a/scripts/instantiator.py
+++ b/scripts/instantiator.py
@@ -8,6 +8,7 @@ from typing import Any, Dict, List, Mapping, Set, Tuple, Union
 import attr
 import fontMath
 import fontTools.designspaceLib as designspaceLib
+import fontTools.misc.fixedTools
 import fontTools.ufoLib as ufoLib
 import fontTools.varLib as varLib
 import ufoLib2
@@ -15,6 +16,8 @@ import ufoLib2
 FontMathObject = Union[fontMath.MathGlyph, fontMath.MathInfo, fontMath.MathKerning]
 Location = Mapping[str, float]
 
+fontMath.mathFunctions.setRoundIntegerFunction(fontTools.misc.fixedTools.otRound)
+
 
 @attr.s(auto_attribs=True, frozen=True, slots=True)
 class Instantiator:
diff --git a/scripts/make-static-fonts.py b/scripts/make-static-fonts.py
index d956c8b3..95f5890d 100644
--- a/scripts/make-static-fonts.py
+++ b/scripts/make-static-fonts.py
@@ -50,10 +50,6 @@ if __name__ == "__main__":
     ]
 
     # 2. Prepare masters.
-    # XXX: varLib rounds with fontTools.misc.fixedTools.otRound, fontMath rounds with
-    # fontTools.misc.py23.round3. This leads to off-by-one coordinates between
-    # instances and a variable font.
-    # https://github.com/robotools/fontMath/issues/148
     generator = instantiator.Instantiator.from_designspace(
         designspace, round_geometry=True
     )


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