--compact-style-names flag to workI am generating the designspace and UFO masters with:
make designspace
...then building the varfont with:
misc/fontbuild compile-var --compact-style-names -o build/fonts/var/Inter.var.ttf src/Inter.designspace
However, the instance names don't seem to have any change from their typical versions.
The --compact-style-names build flag was introduced to make names compatible with Google Fonts standards (https://github.com/google/fonts/pull/1908). However, if the help text is accurate, the naming convention from --compact-style-names isn't _quite_ accurate.
argparser.add_argument('--compact-style-names', action='store_true',
help="Produce font files with style names that doesn't contain spaces. "\
"E.g. \"SemiBoldItalic\" instead of \"Semi Bold Italic\"")
def collapseFontStyleName(font):
# collapse whitespace in style name. i.e. "Semi Bold Italic" -> "SemiBoldItalic"
font.info.styleName = re.sub(r'\s', '', font.info.styleName)
# update info to have style changes "trickle down" to other metadata
setFontInfo(font, font.info.openTypeOS2WeightClass)
Here's the output of FontBakery specifying the expected style names:
🔥 FAIL: Check variable font instances have correct names
- com.google.fonts/check/varfont_instance_names
- Instance name "Extra Light" is incorrect. It should be "ExtraLight" [code: bad-name]
- Instance name "Extra Light Italic" is incorrect. It should be "ExtraLight Italic" [code: bad-name]
- Instance name "Semi Bold" is incorrect. It should be "SemiBold" [code: bad-name]
- Instance name "Semi Bold Italic" is incorrect. It should be "SemiBold Italic" [code: bad-name]
- Instance name "Extra Bold" is incorrect. It should be "ExtraBold" [code: bad-name]
- Instance name "Extra Bold Italic" is incorrect. It should be "ExtraBold Italic" [code: bad-name]
This will cause problems with some of the Google Fonts systems that look up fonts by their style names. This must be fixed! [code: bad-instance-names]
Admittedly, I should have caught this detail in the Pull Request thread.
Possibly, the most straightforward way to handle this is to just find instances of Extra Light,Semi Bold, and Extra Bold in the designspace, then edit these to remove spaces. The other possibility is that it could be fixed in the ttf, with FontTools.
To Reproduce
Steps to reproduce the behavior:
./init.sh to set up the projectmake designspace to set up the buildmisc/fontbuild compile-var --compact-style-names -o build/fonts/var/Inter.var.ttf src/Inter.designspace to build the variable font with compact-style-names flagExpected behavior
Instance names should be like ExtraBold Italic, not like Extra Bold Italic nor ExtraBoldItalic.
Environment
Thanks! This, "the flipped q” and some other issues are all related to me upgrading fontmake which caused some code of the fontbuild program not to be invoked. Working on a fix now!
Okay, issues #198 and #202 have been resolved in 0ba7c2b42f06dd2ded8cdeca8563dadf089f1d14.
Prior to that commit I also introduced a new make target dedicated to Google fonts with the creative name “googlefonts”:
make -j googlefonts
This puts fonts into build/googlefonts with compact style names.
We can use this makefile target to add any additional things we might want for Google fonts.
Introduced in bc8b267b01d4652334e6f4a5452e77fbf79b329d
The output file structure looks like this: (easy to change if we want to)

Awesome! This seems great. I’ll take another run through of things for the google/fonts PR this week. 🙂
Most helpful comment
Okay, issues #198 and #202 have been resolved in 0ba7c2b42f06dd2ded8cdeca8563dadf089f1d14.
Prior to that commit I also introduced a new make target dedicated to Google fonts with the creative name “googlefonts”:
This puts fonts into
build/googlefontswith compact style names.We can use this makefile target to add any additional things we might want for Google fonts.
Introduced in bc8b267b01d4652334e6f4a5452e77fbf79b329d
The output file structure looks like this: (easy to change if we want to)
