summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2018-02-18 07:17:55 +0300
committerRasmus Andersson <rasmus@notion.se>2018-02-18 07:17:55 +0300
commit34a5d1b31f99eb6be442be22964728b075b2c7c5 (patch)
treedac1b529662244b55bbbf6f97ca9d694f2429303
parentc06dd62eafeb5f76cf5aad7fbc1b14ebee08c5c1 (diff)
downloadinter-34a5d1b31f99eb6be442be22964728b075b2c7c5.tar.xz
minor change to fontbuild
-rw-r--r--misc/pylib/fontbuild/Build.pyx25
1 files changed, 13 insertions, 12 deletions
diff --git a/misc/pylib/fontbuild/Build.pyx b/misc/pylib/fontbuild/Build.pyx
index 567e1a4c9..ec6a7f59d 100644
--- a/misc/pylib/fontbuild/Build.pyx
+++ b/misc/pylib/fontbuild/Build.pyx
@@ -148,18 +148,19 @@ class FontProject:
# adjust width of italic glyphs
if italic == True:
widthAdjustment = -8
- leftAdjustment = math.floor(widthAdjustment / 2)
- rightAdjustment = math.ceil(widthAdjustment / 2)
- for g in f:
- if g.name not in self.noItalic:
- if g.width != 0:
- if g.box is None:
- g.width += widthAdjustment
- else:
- newLeftMargin = int(g.leftMargin + leftAdjustment)
- newRightMargin = int(g.rightMargin + rightAdjustment)
- g.leftMargin = newLeftMargin
- g.rightMargin = newRightMargin
+ if widthAdjustment != 0:
+ leftAdjustment = math.floor(widthAdjustment / 2)
+ rightAdjustment = math.ceil(widthAdjustment / 2)
+ for g in f:
+ if g.name not in self.noItalic:
+ if g.width != 0:
+ if g.box is None:
+ g.width += widthAdjustment
+ else:
+ newLeftMargin = int(g.leftMargin + leftAdjustment)
+ newRightMargin = int(g.rightMargin + rightAdjustment)
+ g.leftMargin = newLeftMargin
+ g.rightMargin = newRightMargin
log(">> Decomposing")
# for g in f: