A fascinating look at Google Fonts from @stoyan shows the median size for variable (Latin-extended) web font on the service is 34744 bytes.
Hefty!
https://www.phpied.com/web-font-file-size-study-a-variable-font-addition/
@zachleat i had to look it up, it was Playfair Display and it had two variable woff2 format (for web?) files. Each 500KB!
The TTF were 1.4MB each
@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!
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.
@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?