Commit efe9d938baa4c5084ce2d628295c532a4e8d75a8

Darren Embry 2023-11-17T21:02:08

separate bin directory for any scripts

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"])