Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ninja Builder #569

Merged
merged 37 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aff3897
WIP Ninja Builder
simoncozens Jun 1, 2022
3bd07ee
Handle static targets and webfonts (no autohinting, no instances: con…
simoncozens Jun 1, 2022
6bcbb60
Call ninja and build it
simoncozens Jun 1, 2022
f7ec3f8
Do autohinting too
simoncozens Jun 1, 2022
b7fefaa
Run ninja by default, fallback for unimplemented stuff
simoncozens Jun 6, 2022
3896c35
Add ninja extras_require
simoncozens Jun 6, 2022
b697b2f
madig nit
simoncozens Jun 6, 2022
fb9ff76
Speed up initial ninja.build creation
simoncozens Jun 14, 2022
e90cd24
Maintain instance UFO filenames (because fontmake does)
simoncozens Jun 14, 2022
fd4cd13
Skip a few more stages
simoncozens Jun 15, 2022
8463706
Munge UFO paths
simoncozens Jun 15, 2022
1e95e60
Clean up temporaries
simoncozens Jun 15, 2022
bc02a78
Fix weird syntax
simoncozens Jun 16, 2022
e672efc
OK, just take their word for it
simoncozens Jun 16, 2022
8cc95c1
Pass fontmake args to fontmake!
simoncozens Jun 17, 2022
447ace2
Fail harder when fixing/autohinting
simoncozens Jun 29, 2022
cda2860
Run in serial when debugging
simoncozens Jun 30, 2022
5205454
Only tidy up stamps if they actually got created
simoncozens Jun 30, 2022
6763b3a
Propagate exit code
simoncozens Jul 1, 2022
b1fb994
Use the console pool when debugging
simoncozens Aug 1, 2022
6cf36a2
Axis order no long required for gen-stat
simoncozens Oct 10, 2022
08d7279
Don't explode if there are no instances defined
simoncozens Dec 30, 2022
e006f2b
Fix instance UFO directory
simoncozens Jan 20, 2023
1510d4f
Support glyphs packages
simoncozens Jan 20, 2023
51c014e
Use new style post-process methods
simoncozens Jan 20, 2023
9b4c0b0
Save STAT table config to yaml and pass as file to genstat
simoncozens Jan 20, 2023
b8f9772
Make sure the directory where we write the stat file exists
simoncozens Jan 20, 2023
378eae5
Save and restore cwd
simoncozens Jul 27, 2023
83a7a45
Use new utility file names
simoncozens Jul 27, 2023
f6003a5
GSFont doesn’t deal with glyphspackages yet, use load instead
simoncozens Jul 27, 2023
ba4f7b8
Plug ninja build into builder
simoncozens Jul 27, 2023
4b37d5c
No longer needed, pyproject installs binary from lib
simoncozens Jul 27, 2023
c8aa87f
Post-process variable fonts, fix webfont directory
simoncozens Jul 27, 2023
37e038a
Wrap bare UFOs in mock designspace
simoncozens Jul 27, 2023
ed6ff51
Don't try ninja builder on Windows
simoncozens Jul 27, 2023
3f480e8
Only import NinjaBuilder on non-Windows
simoncozens Jul 28, 2023
94a4968
Use correct instance directory
simoncozens Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Lib/gftools/builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
import argparse
import logging
import os
import platform
import re
import shutil
import statmake.classes
Expand Down Expand Up @@ -642,17 +643,29 @@ def main(args=None):

args = parser.parse_args(args)

builder_class = GFBuilder

try:
if platform.system() != "Windows":
from gftools.builder._ninja import NinjaBuilder

builder_class = NinjaBuilder
except ImportError as e:
simoncozens marked this conversation as resolved.
Show resolved Hide resolved
pass

if len(args.file) == 1 and (
args.file[0].endswith(".yaml") or args.file[0].endswith(".yml")
):
builder = GFBuilder(configfile=args.file[0])
builder_args = dict(configfile=args.file[0])
else:
config={"sources": args.file}
if args.stylespace:
config["stylespaceFile"] = args.stylespace
if args.family_name:
config["familyName"] = args.family_name
builder = GFBuilder(config=config)
builder_args = dict(config=config)

builder = builder_class(**builder_args)

if args.no_autohint:
builder.config["autohintTTF"] = False
Expand All @@ -672,7 +685,11 @@ def main(args=None):
fp.write(yaml.dump(config, Dumper=yaml.SafeDumper))
sys.exit()

builder.build()
try:
builder.build()
except NotImplementedError:
builder = GFBuilder(**builder_args)
builder.build()

if __name__ == "__main__":
main()
Loading
Loading