diff options
author | Rasmus Andersson <rasmus@notion.se> | 2018-08-28 19:43:39 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2018-08-28 19:44:04 +0300 |
commit | 18ba0aee6a280ee808f9279f5f7e57315c3ee073 (patch) | |
tree | d916204cd94d7fa383278556185e19f7c99bc0dc /misc/pylib/fontbuild | |
parent | 5ecf53902eb46db2162d1428d38eb175fd743e97 (diff) | |
download | inter-18ba0aee6a280ee808f9279f5f7e57315c3ee073.tar.xz |
upgrade dependencies
Diffstat (limited to 'misc/pylib/fontbuild')
-rw-r--r-- | misc/pylib/fontbuild/Build.pyx | 28 | ||||
-rw-r--r-- | misc/pylib/fontbuild/mix.pyx | 12 |
2 files changed, 26 insertions, 14 deletions
diff --git a/misc/pylib/fontbuild/Build.pyx b/misc/pylib/fontbuild/Build.pyx index ec6a7f59d..807ed6991 100644 --- a/misc/pylib/fontbuild/Build.pyx +++ b/misc/pylib/fontbuild/Build.pyx @@ -17,6 +17,7 @@ import ConfigParser import os import sys import math +import warnings from booleanOperations import BooleanOperationManager @@ -339,14 +340,19 @@ def removeGlyphOverlap(g): def saveOTF(font, destFile, glyphOrder, truetype=False): """Save a RoboFab font as an OTF binary using ufo2fdk.""" - - if truetype: - otf = compileTTF(font, featureCompilerClass=RobotoFeatureCompiler, - kernWriter=RobotoKernWriter, glyphOrder=glyphOrder, - convertCubics=False, - useProductionNames=False) - else: - otf = compileOTF(font, featureCompilerClass=RobotoFeatureCompiler, - kernWriter=RobotoKernWriter, glyphOrder=glyphOrder, - useProductionNames=False) - otf.save(destFile) + with warnings.catch_warnings(): + # Note: ignore warnings produced by compreffor, used by ufo2ft: + # 'Compreffor' class is deprecated; use 'compress' function instead + # which is triggered by ufo2ft which we can't update because newer + # versions completely break the API of ufo2ft. + warnings.simplefilter("ignore") + if truetype: + otf = compileTTF(font, featureCompilerClass=RobotoFeatureCompiler, + kernWriter=RobotoKernWriter, glyphOrder=glyphOrder, + convertCubics=False, + useProductionNames=False) + else: + otf = compileOTF(font, featureCompilerClass=RobotoFeatureCompiler, + kernWriter=RobotoKernWriter, glyphOrder=glyphOrder, + useProductionNames=False) + otf.save(destFile) diff --git a/misc/pylib/fontbuild/mix.pyx b/misc/pylib/fontbuild/mix.pyx index 7034a189d..9be434b6a 100644 --- a/misc/pylib/fontbuild/mix.pyx +++ b/misc/pylib/fontbuild/mix.pyx @@ -16,11 +16,17 @@ from numpy import array, append import copy import json -from robofab.objects.objectsRF import RPoint, RGlyph +from robofab.objects.objectsRF import RGlyph from robofab.world import OpenFont from decomposeGlyph import decomposeGlyph +class Vec2: + def __init__(self, x, y): + self.x = x + self.y = y + + class FFont: "Font wrapper for floating point operations" @@ -230,7 +236,7 @@ class Master: self.font = font self.ffont = FFont(font) if isinstance(v,float) or isinstance(v,int): - self.v = RPoint(v, v) + self.v = Vec2(v, v) else: self.v = v if kernlist != None: @@ -263,7 +269,7 @@ class Mix: def __init__(self,masters,v): self.masters = masters if isinstance(v,float) or isinstance(v,int): - self.v = RPoint(v,v) + self.v = Vec2(v,v) else: self.v = v |