zachleat.com is one of the many independent Mastodon servers you can use to participate in the fediverse.

Server stats:

1
active users

@zachleat One reason I haven't even bothered looking into Variable Fonts beyond the initial concept is I saw how freaking huge the file size is on them. (Well, the ones I looked at anyway) @stoyan

@zachleat @stoyan

I was wondering about this the other month, there was a variable version of a font we were using that was like 1.3Mb, surely that defeats the point!

@r0b great multi-language support on that one! (read: subsetting needed 😅)

@zachleat @r0b 1.4Mb TTF (source) becomes 278K after subset to latin only and turned to WOFF:
glyphhanger --subset="PlayfairRomanVF.ttf" --LATIN --formats=woff2
Though the subset didn't remove too many characters. Its LATIN supports 713 characters (down from 1603) which is very exhaustive. 3 times what the average Google font supports when subset to LATIN

I wonder if it's the "Optical size" axis that makes fonts bigger (as another comment suggested)

@r0b @zachleat @stoyan Variable fonts are hard to compare as you never know which axes it has, and each axis can add a significant amount of data (especially for large charsets)! Like the article says, a variable font with just a weight axis will be smaller than two old-fashioned Regular and Bold fonts — except when it also has an italic axis, optical sizing, a couple of custom axis... that sounds like something that ends up as a 1.3MB font!

@zachleat @stoyan It might be interesting to look at how many masters a font has. Some fonts can interpolate all the way from font weight 1 to 1000 on a single master (the "default" lettershapes where other weights are calculated from). But some fonts need to switch to a different set of lettershapes halfway through because the differences between the extremes is too big. In that case you suddenly have two variable fonts inside one, so to speak. This obviously increases a font's size a lot!

@zachleat

Something went wrong with the tooling here.

@stoyan has YsabeauInfant[wght]-subset.woff2 at 58688 bytes.

I have:

$ glyphhanger --subset="*.ttf" --US_ASCII --formats=woff2
...
Subsetting YsabeauInfant[wght].ttf to YsabeauInfant[wght]-subset.woff2 (was 373.46 KB, now 40.69 KB)

And I also have:

$ hb-subset --unicodes=20-7e YsabeauInfant\[wght\].ttf -o YsabeauInfant\[wght\]-subset.ttf
$ woff2_compress YsabeauInfant\[wght\]-subset.ttf
Compressed 36642 to 21142.

@zachleat @stoyan
The actual Ysabeau Infant as served by the Google Fonts API is 37808 bytes, but that's a slightly bigger subset than just ASCII.

@simoncozens @zachleat I used --LATIN subset for the experiment. YsabeauInfant[wght]-subset ended up being 241 characters where US_ASCII should be 95-ish right?

@simoncozens @zachleat woff2_compress... nice, I haven't seen this. Does it produce even better results than glyphhanger/pyftsubset?

@stoyan @zachleat I think it's the hb-subset which is doing most of the work here.