[cantarell-fonts/alexei-feedback] Update generator script for new fontmake and psautohint



commit cdd983d5503d1cbcc647f5d91d96ef9fe0970d6d
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Thu Aug 2 21:22:23 2018 +0100

    Update generator script for new fontmake and psautohint

 README.md       | 12 +++++++-----
 scripts/fm.py   | 22 ++++++++++++++++------
 src/meson.build | 27 ++++++++++++++-------------
 3 files changed, 37 insertions(+), 24 deletions(-)
---
diff --git a/README.md b/README.md
index d6dd3d40..42f227ee 100644
--- a/README.md
+++ b/README.md
@@ -7,13 +7,15 @@ Build instructions
 ------------------
 
 ```
-pip3 install --user fontmake
-pip3 install --user git+https://github.com/adobe-type-tools/psautohint.git@v1.1.0#egg=psautohint
-# Add both programs to your PATH.
+python3 -m venv venv
+. venv/bin/activate  # Unixoids...
+venv/Scripts/activate  # ...or on Windows cmd.exe or PowerShell
+
+pip3 install meson ninja  # Unless already present on system.
+pip3 install fontmake psautohint
 
 meson build
-cd build
-ninja install
+ninja -C build install
 ```
 
 Contributing
diff --git a/scripts/fm.py b/scripts/fm.py
index e56d5908..cb3b87db 100644
--- a/scripts/fm.py
+++ b/scripts/fm.py
@@ -21,10 +21,20 @@ source = Path(args.font_source).resolve()
 output_dir = Path(args.output_dir)
 
 subprocess.run(
-    [args.fontmake, "-g", source, "-i", "-o", "otf", "--verbose", "WARNING"],
-    cwd=output_dir)
+    [
+        args.fontmake,
+        "-g",
+        source,
+        "-i",
+        "-o",
+        "otf",
+        "--verbose",
+        "WARNING",
+        "--output-dir",
+        args.output_dir,
+    ]
+)
 
-for otf in (output_dir / "instance_otf").glob("*.otf"):
-    subprocess.run([args.psautohint, "-qq", str(otf)])
-    output_dir.mkdir(exist_ok=True)
-    otf.rename(output_dir / otf.name)
+otfs = output_dir.glob("*.otf")
+
+subprocess.run([args.psautohint, *[str(otf) for otf in otfs]])
diff --git a/src/meson.build b/src/meson.build
index 68194ee3..f452eb00 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,13 +1,14 @@
-custom_target('cantarell-fonts',
-              input : 'Cantarell.glyphs',
-              output : [
-                'Cantarell-Thin.otf',
-                'Cantarell-Light.otf',
-                'Cantarell-Regular.otf',
-                'Cantarell-Bold.otf',
-                'Cantarell-ExtraBold.otf'
-              ],
-              command : [python3, fontmake_wrapper, fontmake, psautohint,
-                         '@INPUT@', '@OUTDIR@'],
-              install: true,
-              install_dir : fontsdir)
+custom_target(
+    'cantarell-fonts',
+    input: 'Cantarell.glyphs',
+    output: [
+        'Cantarell-Thin.otf',
+        'Cantarell-Light.otf',
+        'Cantarell-Regular.otf',
+        'Cantarell-Bold.otf',
+        'Cantarell-ExtraBold.otf',
+    ],
+    command: [python3, fontmake_wrapper, fontmake, psautohint, '@INPUT@', '@OUTDIR@'],
+    install: true,
+    install_dir: fontsdir,
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]