In Tor Browser, the value of the layout.css.font-variations.enabled preference changes depending on the operating system version. For example, it is enabled on Windows 10 and disabled on Windows 7 and this can be detected with javascript.
The issue is that the defaults aren't the same. If your Windows version is older than Win10 1709, or macOS older than 10.5 etc. layout.css.font-variations.enabled is locked to false. So this preference leaks whether you are using a recent OS version or not. And worse that it doesn't require javascript to do so.
is that a typo and you meant 10.15? Anyway, the good news is macOS minimum support is now 10.15
Anyway, I think we can close this as no longer valid @pierov - the other option is to force it disabled on windows so we help hide the few (bad) perps using old versions of win10. We should double check what the code says about version support
disable variation fonts on such an old API version. This will potentially regress the rendering of sites that rely on such fonts for their desired styling, but in general most sites should have reasonable fallbacks in place.
most sites .. I don't think we should be disabling it to protect a few old OS versions/API
so, turns out it is actually feasible to use variable fonts on non-supported OSes - but why anyone would bother given users should be uptodate (apologies android =< 6 owners), IDK
So if the platform says "no, I can't do that", the CSS properties will remain disabled regardless of the setting of layout.css.font-variations.enabled, and sites that use @supports will be able to handle fallback appropriately.
For Windows, it's easy: only Fall Creators Update or later supports variations.
For macOS, there has been variation font support in Core Text for some time, but older versions are known to be fairly buggy. I'm proposing to support only 10.12 or later.
For Linux, the installed FreeType version is the key. Local testing suggests that 2.7.1 (released at the end of 2016) is a reasonable cut-off. There was some multiple-master/variation font support present in earlier versions, but there have been enough recent bug-fixes, including ones that directly affect our usage, that enabling it on earlier releases is not helpful.
(On Android, we use in-tree FreeType, so we know we're getting a recent version.)
So if we want to do anything about this, we would want to set the pref to false on all windows and linux @pierov I doubt it would break anything given 15% of the world is still buzzing around on windows 7, and 4% on linux, or whatever it is.
What do you mean by "variable fonts" and "static variants"? I'm now use your word "variants" from #41330 (closed) to describe those font-families. And I use the word face to describe "styles".
If you flip the pref in win 10 and restart, do you still leak in #41330 (closed) ?
What do you mean by "variable fonts" and "static variants"?
I didn't know what term to use, I really know that variant is not the correct one.
Variable fonts = the fonts embed information on how to produce a different "variant" along some axis (weight, slant, stretch, etc...), see some examples.
They are "recent", the old way of producing different weights was providing a font file for each weight, which is also called static fonts nowadays.
And since they are recent, their support is platform-dependent.
Shouldn't this feature be disabled at least on the Safest security level regardless of any OS-specific defaults? (Assuming fonts, webgl etc. are disabled on higher security levels for similar reasons)