Issue: Bit 3 on the flags of the head table

39 views
Skip to first unread message

Ked G

unread,
Oct 29, 2020, 1:19:02 PM10/29/20
to Google Fonts Discussions
I am trying to pass the font bakery challenge for google fonts and a test that keeps failing is "PPEM must be an integer on hinted fonts." The message says:

This is a hinted font, so it must have bit 3 set on the flags of the head table, so that PPEM values will be rounded into an integer value.
This can be accomplished by using the 'gftools fix-hinting' command.

How do I fix this? How can I update the flags value in my ttf files OR instead fix this issue pre-export? I use GlyphsApp.

bgh...@gmail.com

unread,
Oct 29, 2020, 1:23:51 PM10/29/20
to Google Fonts Discussions
Hi Ked!

You'll want to install gftools from https://github.com/googlefonts/gftools in a python virtual environment.

once you've installed gftools in your venv, you'll want to run the command gftools fix-hinting yourfontname.ttf on your font.

putting this all inside of a build script will help others install your font from source. 

here's a link to a repo i made for a small fontbakery workshop with links at the bottom to a lot of helpful tools for font baking.

good luck!
-mirko

Dave Crossland

unread,
Oct 29, 2020, 1:55:52 PM10/29/20
to googlefonts-discuss, Felipe Sanches
Did the gftools fix-hinting command not address this?

The check itself may be buggy. 

--
You received this message because you are subscribed to the Google Groups "Google Fonts Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googlefonts-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/googlefonts-discuss/31831337-61b4-40e7-a593-53e394a81269n%40googlegroups.com.

Ked G

unread,
Oct 29, 2020, 3:11:27 PM10/29/20
to Google Fonts Discussions
Thanks for the replies. 
I ran the gftools fix-hinting <ttf-file> command on each ttf font file and it generates a .ttf.fix file for each font file.
Is this an expected behavior? How do I proceed from here?


Dave Crossland

unread,
Oct 29, 2020, 3:15:15 PM10/29/20
to googlefonts-discuss
Install fonttools and run 

ttx font.ttx

That will by default create font.ttf

bgh...@gmail.com

unread,
Oct 29, 2020, 3:34:27 PM10/29/20
to Google Fonts Discussions
I'm not sure about that Dave. I think fix-hinting adds a .fix extension to new copies of the original fonts that it has fixed. 

you could try this ked. 

fonts=$(path/to/your/*.ttf)
echo "Fixing Hinting"
for font in $fonts
do
# gftools fix-hinting $font;
gftools fix-hinting $font $font;
if [ -f "$font.fix" ]; then mv "$font.fix" $font; fi
done


Ked G

unread,
Oct 29, 2020, 4:24:08 PM10/29/20
to Google Fonts Discussions
Thanks Dave and bghryct 🙏
This has been definitely helpful.

For anyone having the same issue, here's the solution summary:
- Get gftools
- Run gftools fix-hinting font-name.ttf
  This will generate a file: font-name.ttf.fix
- Discard the font-name.ttf file and rename font-name.ttf.fix to font-name.ttf

To automate this for multiple files, here's a modified version of bghryct's script that worked for me:
echo "Fixing Hinting"
for font in *.ttf
do
gftools fix-hinting $font;
if [ -f "$font.fix" ]; then mv "$font.fix" $font; fi
done

Be sure to be inside the same folder as the *.ttf files to avoid chmod issues.

bgh...@gmail.com

unread,
Oct 30, 2020, 7:31:44 PM10/30/20
to Google Fonts Discussions
glad it worked for you! 
Reply all
Reply to author
Forward
0 new messages