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

Supporting fontc as an experimental alternative compiler #1045

Open
cmyr opened this issue Oct 14, 2024 · 5 comments
Open

Supporting fontc as an experimental alternative compiler #1045

cmyr opened this issue Oct 14, 2024 · 5 comments

Comments

@cmyr
Copy link
Member

cmyr commented Oct 14, 2024

I would like to start testing using fontc in place of fontmake in the gftools builder pipeline, and I'm hoping to discuss how best to do this. Ideally this work would be isolated and non-invasive enough that it could happen in this repo, instead of in a fork.

The main requirement for this work would be some way to pass a flag that would opt us into fontc mode. I imagine that this would involve adding some new 'Operations' that can be run in place of the current BuildOTF and BuildVariable classes, and which would be backed by fontc. (An environment variable could be used to pass a path to the fontc executable.)

When the user passed the --experimental-fontc (or whatever) flag, we would then use the alternative operations instead of the default ones; I'm not sure how best to plumb this through, but I could imagine possibly modifying the known_operations or else adding an operation_overrides dict or something like that; I imagine this project's maintainers might have a better sense of how best to do this.

Does this make approximate sense? Is there anything else I'm missing?

@simoncozens
Copy link
Contributor

There's precedent for using alternative implementations of an operation: see the (now badly-named) hbsubset operation which can be switched between hb-subset and pyftsubset. But that's a bit easier to handle because the command line arguments are deliberately identical; we can just have a $subsetter variable in the ninja rule and set it appropriately.

How compatible are fontmake and fontc command lines?

@rsheeter
Copy link
Contributor

Thinking "aloud" we are eventually going to need gftools in Rust which makes me wonder if we should begin to spin that up.

@cmyr
Copy link
Member Author

cmyr commented Oct 14, 2024

There's precedent for using alternative implementations of an operation: see the (now badly-named) hbsubset operation which can be switched between hb-subset and pyftsubset. But that's a bit easier to handle because the command line arguments are deliberately identical; we can just have a $subsetter variable in the ninja rule and set it appropriately.

How compatible are fontmake and fontc command lines?

They aren't identical but if I know the fontmake args I can try to rewrite them for fontc?

@simoncozens
Copy link
Contributor

See notes on above PR.

@cmyr
Copy link
Member Author

cmyr commented Oct 15, 2024

Opened #1047 to show loosely how I imagine this could work. @simoncozens can you identify any possible problems with that approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants