summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/italics.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/fontbuild/italics.py')
-rw-r--r--scripts/lib/fontbuild/italics.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/lib/fontbuild/italics.py b/scripts/lib/fontbuild/italics.py
index 8e12619..d32630a 100644
--- a/scripts/lib/fontbuild/italics.py
+++ b/scripts/lib/fontbuild/italics.py
@@ -1,16 +1,14 @@
from fontTools.misc.transform import Transform
-from robofab.world import CurrentFont
from robofab.world import RFont
from time import clock
import numpy as np
import math
from alignpoints import alignCorners
-def italicizeGlyph(g, angle=10, stemWidth=185):
- f = CurrentFont()
+def italicizeGlyph(f, g, angle=10, stemWidth=185):
glyph = f[g.name]
- slope = np.tanh([math.pi * angle / 180])
-
+ slope = np.tanh([math.pi * angle / 180])[0]
+
# determine how far on the x axis the glyph should slide
# to compensate for the slant. -600 is a magic number
# that assumes a 2048 unit em square