diff options
author | Rasmus Andersson <rasmus@notion.se> | 2017-08-22 10:05:20 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2017-08-22 12:23:08 +0300 |
commit | 3b1fffade1473f20f2558733fbd218f4580fc7c3 (patch) | |
tree | ea4f80b43b08744d493bb86ab646444ec04ddc7f /misc/rf-scripts/ZeroWidth.py | |
download | inter-3b1fffade1473f20f2558733fbd218f4580fc7c3.tar.xz |
Initial public commitv1.0
Diffstat (limited to 'misc/rf-scripts/ZeroWidth.py')
-rw-r--r-- | misc/rf-scripts/ZeroWidth.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/misc/rf-scripts/ZeroWidth.py b/misc/rf-scripts/ZeroWidth.py new file mode 100644 index 000000000..a9277d09c --- /dev/null +++ b/misc/rf-scripts/ZeroWidth.py @@ -0,0 +1,26 @@ +# +# This script changes the width of all glyphs by applying a multiplier. +# It keeps the contours centered as glyphs get wider or tighter. +# +from mojo.roboFont import version +from math import ceil, floor + +if __name__ == "__main__": + font = CurrentFont() + print "Resizing glyph margins for %r" % font + + if font is not None: + for g in font: + leftMargin = g.leftMargin + rightMargin = g.rightMargin + + if leftMargin < 0 or rightMargin < 0: + g.rightMargin = int(max(0, rightMargin)) + g.leftMargin = int(max(0, leftMargin)) + print("adjust %s" % g.name) + + font.update() + else: + print "No fonts open" + + print "Done" |