separate bin directory for any scripts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/bin/convert.py b/bin/convert.py
new file mode 100755
index 0000000..a31a4f8
--- /dev/null
+++ b/bin/convert.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env fontforge
+# -*- mode: python; coding: utf-8 -*-
+
+import fontforge
+import os
+import re
+import string
+
+def convert(source, dests):
+ print("Reading %s" % source)
+ font = fontforge.open(source)
+ lastDest = None
+ for dest in dests:
+ print("< dest = %s" % dest)
+ if re.fullmatch(r'^\.[A-Za-z0-9]+$', dest):
+ if lastDest is None:
+ raise Exception("first filename cannot be an extension: %s" % dest)
+ else:
+ dest = os.path.splitext(lastDest)[0] + dest
+ print("> dest = %s" % dest)
+ if os.path.splitext(dest)[1] == ".sfd":
+ print("Writing %s using font.save()" % dest)
+ font.save(dest)
+ else:
+ print("Writing %s using font.generate()" % dest)
+ font.generate(dest)
+ lastDest = dest
+
+convert("sfd/IBM-Courier-Bold-Italic.sfd", ["fonts/IBM-Courier-Bold-Italic.ttf",
+ ".otf", ".svg", ".woff", ".woff2"])
+convert("sfd/IBM-Courier.sfd", ["fonts/IBM-Courier.ttf",
+ ".otf", ".svg", ".woff", ".woff2"])
+convert("sfd/IBM-Courier-Italic.sfd", ["fonts/IBM-Courier-Italic.ttf",
+ ".otf", ".svg", ".woff", ".woff2"])
+convert("sfd/IBM-Courier-Bold.sfd", ["fonts/IBM-Courier-Bold.ttf",
+ ".otf", ".svg", ".woff", ".woff2"])
diff --git a/convert.py b/convert.py
deleted file mode 100755
index a31a4f8..0000000
--- a/convert.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env fontforge
-# -*- mode: python; coding: utf-8 -*-
-
-import fontforge
-import os
-import re
-import string
-
-def convert(source, dests):
- print("Reading %s" % source)
- font = fontforge.open(source)
- lastDest = None
- for dest in dests:
- print("< dest = %s" % dest)
- if re.fullmatch(r'^\.[A-Za-z0-9]+$', dest):
- if lastDest is None:
- raise Exception("first filename cannot be an extension: %s" % dest)
- else:
- dest = os.path.splitext(lastDest)[0] + dest
- print("> dest = %s" % dest)
- if os.path.splitext(dest)[1] == ".sfd":
- print("Writing %s using font.save()" % dest)
- font.save(dest)
- else:
- print("Writing %s using font.generate()" % dest)
- font.generate(dest)
- lastDest = dest
-
-convert("sfd/IBM-Courier-Bold-Italic.sfd", ["fonts/IBM-Courier-Bold-Italic.ttf",
- ".otf", ".svg", ".woff", ".woff2"])
-convert("sfd/IBM-Courier.sfd", ["fonts/IBM-Courier.ttf",
- ".otf", ".svg", ".woff", ".woff2"])
-convert("sfd/IBM-Courier-Italic.sfd", ["fonts/IBM-Courier-Italic.ttf",
- ".otf", ".svg", ".woff", ".woff2"])
-convert("sfd/IBM-Courier-Bold.sfd", ["fonts/IBM-Courier-Bold.ttf",
- ".otf", ".svg", ".woff", ".woff2"])