From 18ba0aee6a280ee808f9279f5f7e57315c3ee073 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Tue, 28 Aug 2018 09:43:39 -0700 Subject: upgrade dependencies --- misc/pylib/fontbuild/Build.pyx | 28 +++++++++++++++++----------- misc/pylib/fontbuild/mix.pyx | 12 +++++++++--- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'misc/pylib/fontbuild') 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 -- cgit v1.2.3