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

Chain autohinting parameters from Glyphs source to fontmake #850

Merged
merged 15 commits into from
Jan 28, 2022

Conversation

yanone
Copy link
Contributor

@yanone yanone commented Jan 28, 2022

I wouldn't know how to write a test for this, so unless you insist, I'm skipping

Lib/fontmake/font_project.py Outdated Show resolved Hide resolved
Lib/fontmake/font_project.py Outdated Show resolved Hide resolved
@anthrotype
Copy link
Member

I wouldn't know how to write a test for this, so unless you insist, I'm skipping

I would insist, if you guys don't mind :)
You can make a simple test .glyphs file with one master and one instace, add the custom parameter to the instance, check that in the tests directory along side other test files, then add a new test test_main.py where you call fontmake to create the instance ttf, and then load the built TTFont and make sure that it's hinted (check for some key hinting table like fpgm or whatever).

@anthrotype
Copy link
Member

to make the test run on the CI, you would have to first install ttfautohint. The easiest would be to use homebrew on the mac CI runner.
This reminds me we have ttfautohint-py (which is pip installable) but fontmake isn't making use of it.. #562

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

to make the test run on the CI, you would have to first install ttfautohint. The easiest would be to use homebrew on the mac CI runner.

Please advise on how to do this. I don't get the CI setup here.

@anthrotype
Copy link
Member

Please advise on how to do this. I don't get the CI setup here.

i'm working on hooking up fontmake to ttfautohint-py, after which it'll be easier to pip install ttfautohint-py like a regular python module

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

I added a test. Please review it. I'm now quietly assuming that TTFAutohint is installed via brew.

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

I'm now quietly assuming that TTFAutohint is installed via brew.

Of course it fails now. Waiting for further instructions

@anthrotype
Copy link
Member

After #851 is merged on main, you should be able to merge main into your PR branch (or rebase on main) and your test should just work

@anthrotype
Copy link
Member

@yanone I merged #851, so when you can please git pull, then git merge main and push.

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

At the expense of exposing my ignorance, I can't get this to run. Neither of your proposed commands do anything in my fork, be it main branch or the PR's branch. I'm not good with working with branches. I normally update my fork with git merge upstream/main, but that also doesn't work: Already up to date.

@anthrotype
Copy link
Member

yes, that's what I mean git merge upstream/main. But first you need to git fetch upstream otherwise you don't see the newly added commits

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

So that line with the lib key is too long for flake8, which is why I originally broke it.

@anthrotype
Copy link
Member

Add # noqa: B950 next to it to mute flake8

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

And the pypy test fails (to install ttfautohint-py): https://github.com/googlefonts/fontmake/runs/4982698831?check_suite_focus=true#step:5:510

@anthrotype
Copy link
Member

And the pypy test fails

pls ignore that for now, I'll investigate and fix that separately.

The PR looks good to me, I'll merge and take over from here. Thank you!

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

Thanks

@anthrotype
Copy link
Member

one last thing, actually. That test .glyphs file you added, what's its license? If you don't add any special license file for it, it'll automatically get the license of the rest of the codebase.

Also, it's quite big and long, can you make a subset that contains only a couple glyphs? We don't need the full font just to exercise the ttfautohint code path.

@yanone
Copy link
Contributor Author

yanone commented Jan 28, 2022

It's OFL, so I didn't care. I already subsetted it to just the basic Latin A-Z and a-z. First I had just the A in it, but ttfautohint required a bunch of different characters to take measurements from, so I re-added the basics. I would have to dive into ttfautohint to make the minimum subset.

@anthrotype anthrotype merged commit 05f7202 into googlefonts:main Jan 28, 2022
@anthrotype
Copy link
Member

I filed fonttools/ttfautohint-py#11 for ttfautohint-py failing on pypy3. I'll just skip the test on pypy for now.

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

Successfully merging this pull request may close these issues.

3 participants