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

Can we retain untouched ttf hints? #12

Open
100amps opened this issue Apr 24, 2023 · 3 comments
Open

Can we retain untouched ttf hints? #12

100amps opened this issue Apr 24, 2023 · 3 comments

Comments

@100amps
Copy link

100amps commented Apr 24, 2023

Would it be possible to export to TTF retaining existing TTF hints, overwriting only the glyph hints that have been touched by ygt? I'm thinking of a workflow that allows me to use ttfauothint and only manually hint the glyphs that need improvement.

@psb1558
Copy link
Owner

psb1558 commented Apr 25, 2023

Funny you should mention that. Xgridfit (the backend for Ygt) has a thing called "merge mode," which adds hints to a font that already has them, appending new instructions after the ones already in the font, new control program code after the existing code, and new CVs after the existing ones. It's meant for exactly the situation where ttfautohint does a good job in general, but you want to replace certain glyph programs that aren't cutting it. Sooner or later I'll implement "merge mode" from within Ygt, but even now you can use it. Just hint the glyphs you want to hint and save in a YAML file (or copy the file data/org.ygthinting/source out of your UFO). Run Xgridfit against the YAML file like this:

xgridfit -y myfile.yaml myfile.xgf

Xgridfit will produce a file myfile.xgf in its own native language. Then run the file myfile.xgf against the autohinted .ttf font in merge mode:

xgridfit -m myfile.xgf

Xgridfit will produce a .ttf font with your hints layered on top of the ones that ttfautohint added to the font.

I should mention that Ygt can't edit glyph programs added by ttfautohint: their ways of doing things are just too different. Ygt can only replace glyph programs.

I'll make this much easier when I can. In the meantime, the procedure I've outlined should work.

@100amps
Copy link
Author

100amps commented Apr 25, 2023

Thank you.

@psb1558
Copy link
Owner

psb1558 commented May 11, 2023

This is done now. See the section "Merge Mode" in YGT-Intro.pdf. If you can, try out the new binary releases on this site: one for the M1 Mac and the other for x86-64 Windows machines. Otherwise, the new version will be on PyPi later today or tomorrow.

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

2 participants