Open m4rc1e opened 1 year ago
format 5 is PaintVarLinearGradient
. OT-SVG does not support variations whatsoever, so converting a variable COLRv1 font to SVG won't work. We should provide a better error message perhaps.
For the same reason, a variable COLRv1 font like FoldIt doesn't work on latest stable Chrome. But it should work on Chrome Canary if you enable the experimental flag chrome://flags/#variable-colrv1
Thanks Cosimo!
So running maximum_color won't work on colr v1 fonts which are variable? if that's the case, we'll need to amend our FB check so it skips VFs.
won't work on COLRv1 fonts that are variable in the COLR table itself. Nabla, for example, only varies in the outlines (gvar) but the COLR is static
Understood. @felipesanches your latest fontbakery check https://github.com/googlefonts/fontbakery/pull/3887 doesn't take this issue into consideration.
but even in the case of a variable COLRv0 (CairoPlay) or COLRv1 with variable outlines but static COLR table (Nabla), running maximum_color will only add a non-variable SVG table (because SVG can't do OT variations). So you'll only see the default outlines in there. Arguably, the resulting VF with hybrid CORL+SVG is kind of broken if it contains variations, say, in the glyph metrics for example, and you variate those at runtime, the SVG outlines will stay static, but the rest of the variable tables will variate: e.g. the metrics of a Bold, with the SVG outlines of a Regular...
I believe (I hope) we currently subset away all the variation data when we serve these fonts to browsers that only understand OT-SVG but not COLR /cc @rsheeter
one thing maximum_color could do is, when it finds PaintVar*
tables, it treats them as their static counterparts, basically ignoring all the deltas and taking only the default instance's values, perhaps with a warning to the user who may not be aware of the lack of variations in OT-SVG (but I wouldn't want to flood the console with too many warnings, perhaps only one if the COLR.VarStore is non empty).
+1 to treat them as their static counterpart; it's not perfect but it's far more likely to be useful than kerploding.
I believe (I hope) we currently subset away all the variation data when we serve these fonts to browsers that only understand OT-SVG but not COLR
We do not. The default request for a family is for a static instance, but if you ask for variation to be included we'll merrily do it.
Just tried running the maximum_color tool on Foldit and got the following traceback:
I wouldn't mind digging into this deeper since it'll probably improve my colr table knowldge which is very lacking atm.
btw, Foldit doesn't work in the latest Chrome yet (probably due to unsupported formats) but we'll make a pr and block it for the time being.