summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-11-13 13:39:25 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-11-13 13:39:25 -0800
commitceb4ae1b523cb0160dbf2ac57b770db0761c68d9 (patch)
treea5e3a055d908b7701e54aedce6ef753e986a5510 /scripts/lib
parent0d5d786360b64d4e789b4311fe54f1180a6c302a (diff)
[italics] Fix import order, remove unused imports
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/fontbuild/alignpoints.py4
-rw-r--r--scripts/lib/fontbuild/curveFitPen.py8
-rw-r--r--scripts/lib/fontbuild/italics.py20
3 files changed, 15 insertions, 17 deletions
diff --git a/scripts/lib/fontbuild/alignpoints.py b/scripts/lib/fontbuild/alignpoints.py
index 76581a5..e3bb539 100644
--- a/scripts/lib/fontbuild/alignpoints.py
+++ b/scripts/lib/fontbuild/alignpoints.py
@@ -13,9 +13,11 @@
# limitations under the License.
+import math
+
import numpy as np
from numpy.linalg import lstsq
-import math
+
def alignCorners(glyph, va, subsegments):
out = va.copy()
diff --git a/scripts/lib/fontbuild/curveFitPen.py b/scripts/lib/fontbuild/curveFitPen.py
index 6ef42da..c2b90ac 100644
--- a/scripts/lib/fontbuild/curveFitPen.py
+++ b/scripts/lib/fontbuild/curveFitPen.py
@@ -19,14 +19,10 @@ __all__ = ["SubsegmentPen","SubsegmentsToCurvesPen", "segmentGlyph", "fitGlyph"]
from fontTools.pens.basePen import BasePen
-from fontTools.misc import bezierTools
-from robofab.pens.pointPen import AbstractPointPen
-from robofab.pens.adapterPens import PointToSegmentPen, GuessSmoothPointPen
import numpy as np
-from numpy.linalg import norm
from numpy import array as v
-from random import random
-
+from numpy.linalg import norm
+from robofab.pens.adapterPens import GuessSmoothPointPen
from robofab.pens.pointPen import BasePointToSegmentPen
diff --git a/scripts/lib/fontbuild/italics.py b/scripts/lib/fontbuild/italics.py
index b1db984..83b123f 100644
--- a/scripts/lib/fontbuild/italics.py
+++ b/scripts/lib/fontbuild/italics.py
@@ -13,12 +13,18 @@
# limitations under the License.
+import math
+
from fontTools.misc.transform import Transform
-from robofab.world import RFont
-from time import clock
import numpy as np
-import math
-from alignpoints import alignCorners
+from numpy.linalg import norm
+from scipy.sparse.linalg import cg
+from scipy.ndimage.filters import gaussian_filter1d as gaussian
+from scipy.cluster.vq import vq, whiten
+
+from fontbuild.alignpoints import alignCorners
+from fontbuild.curveFitPen import fitGlyph, segmentGlyph
+
def italicizeGlyph(f, g, angle=10, stemWidth=185):
unic = g.unicode #save unicode
@@ -111,13 +117,7 @@ def transformFLGlyphMembers(g, m, transformAnchors = True):
a.x = aa[0]
# a.x,a.y = (aa[0] - p[0], aa[1] - p[1])
# a.x = a.x - m[4]
-
-from curveFitPen import fitGlyph,segmentGlyph
-from numpy.linalg import norm
-from scipy.sparse.linalg import cg
-from scipy.ndimage.filters import gaussian_filter1d as gaussian
-from scipy.cluster.vq import vq, kmeans2, whiten
def glyphToMesh(g):
points = []