google / woff2

MIT License
1.52k stars 188 forks source link

Compressing a variable TTF to WOFF2 suffixes font name with lightest weight #170

Open wtflm opened 1 year ago

wtflm commented 1 year ago

Downloading the "Manrope" family from https://fonts.google.com/specimen/Manrope and going woff2_compress Manrope-VariableFont_wght.ttf works nicely but leaves the font name in the metadata as "Manrope ExtraLight". Would it be possible to remove the weight suffix, or specify a custom font name as a parameter for woff2_compress?

YoMyBrudda commented 3 months ago

You can use a font editor such as FontForge or FontLab 8 (They offer a free trial) to change the name and other metadata of the font.

wtflm commented 2 months ago

The problem with FontForge, which I had tried before and did again just now to verify, is that simply editing the name in the original TTF or the already compressed WOFF2 and trying to generate matching output files spits out several warnings and if you press on, you get files with the fixed internal name but with the weight axis stripped. So no matter which weight value you try to use with the edited font, it always comes up as ExtraLight which is arguably a bigger problem.

Now, MAYBE by editing all the other values FontForge complains about upon export and testing even more of the export settings you could get a fully functional, properly named file out of this but a) so far I couldn't figure it out and b) the effort and UI-fiddling seems disproportionate to being able to just set the name as a parameter of the compressor.