summaryrefslogtreecommitdiffstats
path: root/examples/ffremovealloverlaps.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-02 20:01:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-02 20:01:10 +0000
commitda875fcb62c801b8d19b3d4d984ad963574fb356 (patch)
tree3d85503747c56c2a387b291524442946f4bebb73 /examples/ffremovealloverlaps.py
parentInitial commit. (diff)
downloadpysilfont-da875fcb62c801b8d19b3d4d984ad963574fb356.tar.xz
pysilfont-da875fcb62c801b8d19b3d4d984ad963574fb356.zip
Adding upstream version 1.6.0.upstream/1.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/ffremovealloverlaps.py')
-rwxr-xr-xexamples/ffremovealloverlaps.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/ffremovealloverlaps.py b/examples/ffremovealloverlaps.py
new file mode 100755
index 0000000..d5fe178
--- /dev/null
+++ b/examples/ffremovealloverlaps.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+from __future__ import unicode_literals
+'FontForge: Remove overlap on all glyphs in font'
+__url__ = 'http://github.com/silnrsi/pysilfont'
+__copyright__ = 'Copyright (c) 2015 SIL International (http://www.sil.org)'
+__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
+__author__ = 'Victor Gaultney'
+
+from silfont.core import execute
+
+
+''' This will need updating, since FontForge is no longer supported as a tool by execute() So:
+- ifont and ofont will need to be changed to have type 'filename'
+- ifont will then need to be opened using fontforge.open
+- The font will need to be saved with font.save
+- execute will need to be called with the tool set to None instead of "FF"
+'''
+
+
+argspec = [
+ ('ifont',{'help': 'Input font file'}, {'type': 'infont'}),
+ ('ofont',{'help': 'Output font file','nargs': '?' }, {'type': 'outfont', 'def': 'new'})]
+
+def doit(args) :
+ font = args.ifont
+ for glyph in font:
+ font[glyph].removeOverlap()
+ return font
+
+def cmd() : execute("FF",doit,argspec)
+if __name__ == "__main__": cmd()