Open Bug 1302685 Opened 8 years ago Updated 1 year ago

[meta] Support OpenType Font Variations (Variable fonts)

Categories

(Core :: Layout: Text and Fonts, enhancement, P3)

enhancement

Tracking

()

Tracking Status
relnote-firefox --- 62+

People

(Reporter: contact, Unassigned)

References

(Depends on 4 open bugs, Blocks 1 open bug)

Details

(Keywords: DevAdvocacy, feature, meta, Whiteboard: [behind pref "layout.css.font-variations.enabled"])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160823121617




Expected results:

OpenType 1.8 introduces Font Variations, a parametric type design system.

References:
* https://medium.com/@tiro/12ba6cd2369
* http://blog.typekit.com/2016/09/14/variable-fonts-a-new-kind-of-font-for-flexible-design/
* https://opensource.googleblog.com/2016/09/introducing-opentype-font-variations.html
* https://www.microsoft.com/typography/otspec180/otvaroverview.htm

Is this possible to implement support for these new features in Gecko?
It'll be dependent on support in the font rasterizer we use, which varies depending on the platform. So this may become possible at different times on Linux/Android (depending on Freetype support), Mac OS (CoreGraphics) and Windows (DirectWrite).

There's also the issue of the CSS support for font variations (currently under discussion).

We should probably consider this an overall meta-bug for variation-font support, and file dependent bugs for the individual work items that will be needed: probably one for each platform/rasterizer backend, and one (or more) for the CSS side.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: meta
Depends on: 1321022
Depends on: 1321031
Whiteboard: [behind pref "layout.css.font-variations.enabled"]
Blocks: 1323743
Priority: -- → P3
Depends on: 1341085
Depends on: 1341088
Variation Fonts are getting a lot of attention from web designers, typographers, and font companies. They are all very excited about it, especially the performance implications.  

Chrome is already all over this: https://twitter.com/typo_labs/status/850728396099383297

And imo, this is one that will gather steam quickly, and yet, developers won't use it until it's in most browsers — putting extra attention and pressure on any browser that doesn't support it.
QA Whiteboard: [DevRel:P1]
Keywords: DevAdvocacy
Summary: Support OpenType Font Variations → [meta] Support OpenType Font Variations
Depends on: 1360128
Depends on: 1360481
Depends on: 1403299
Depends on: 1403301
Depends on: 1403302
Summary: [meta] Support OpenType Font Variations → [meta] Support OpenType Font Variations (Variable fonts)
Any news on when we plan to implement Variable Font support?
When these flags are set, variable fonts seem to work quite well. I realize there must be more to the story; it would be good to know if there is any way to help/find more support for getting this out from behind the flags.

```
Set layout.css.font-variations.enabled = true.
Set gfx.downloadable_fonts.keep_variation_tables = true.
Set gfx.downloadable_fonts.otl_validation = false.
```
Currently, they're only implemented on macOS. We're working on adding support on other platforms, but it's some way off yet.
Depends on: 1427641
Depends on: 1430632
Depends on: 1434697
Depends on: 1435692
Depends on: 1435983
Depends on: 1435984
Depends on: 1436997
Depends on: 1441323
Depends on: 1442669
Depends on: 1442693
Depends on: 1447600
Depends on: 1451266
Depends on: 1451327
Depends on: 1451345
Depends on: 1455555
Depends on: 1455638
Depends on: 1456547
Depends on: 1457103
Depends on: 1454597
Depends on: 1457412
Depends on: 1457417
Depends on: 1457505
Depends on: 1449605
Depends on: 1458004
Flags: qe-verify?
Flags: behind-pref+
Depends on: 1459158
Depends on: 1459163
Depends on: 1459858
Depends on: 1460543
Blocks: 1457266
Depends on: 1462287
Depends on: 1433438
Depends on: 1456855
Depends on: 1456856
Depends on: 1464094
Added this to 62 nightly + beta release notes and it sounds like we are on track to ship this in 62.
No longer depends on: 1472641
Depends on: 1478716
Depends on: 1478720
Depends on: 1481780
No longer depends on: 1481780
You might want to change the release notes to indicate that variable fonts do not (yet?) work on Windows 7, as this is still the dominant desktop operating system for Firefox users, according to https://data.firefox.com. The current wording will raise expectations and will leave people disappointed. (Especially since variable fonts do actually work in Chrome on Windows 7.)
Depends on: 1492220
Depends on: 1492786
Depends on: 1492789
Type: defect → enhancement

Forgive me if it's already been covered:

I'm building out a new site, and found that WOFF2 variable fonts in OTF flavors work fine in Webkit browsers, but not in Gecko/Firefox, with no errors given. Luckily there are TTF flavors for the same family, but know this may not be the case going forward.

Is this a known bug?

I've also encountered the same problem that @kkaufmann mentioned above: Firefox doesn't seem to support OTF flavours of WOFF2 variable fonts, although they work fine in Chrome/Edge.

For example (in case anyone wants to reproduce this): the Source Sans 3.046 font here:
https://github.com/adobe-fonts/source-sans/releases

This font family includes variable WOFF2 fonts in both TTF and OTF flavours, using these file names:

  • SourceSans3VF-Roman.ttf.woff2 → TTF
  • SourceSans3VF-Roman.otf.woff2 → OTF

If I use the TTF version, it loads correctly in Firefox. But if I use the OTF version, it does not load correctly in Firefox. Firefox instead falls back to the next font family defined in the font-family CSS property for the respective web page text.

Fortunately with this particular font family, both versions are provided. But it's certain to be the case that other font designers might only provide an OTF version of a WOFF2 variable font, and not a TTF version.

FYI, I'm using 64-bit Firefox 92 on Windows 10.

Any chance this can be fixed/improved?

Flags: needinfo?(jfkthame)

I think this is essentially a Windows limitation: the DirectWrite font system does not fully support CFF2 fonts. (Note that some of the Adobe font releases have an explicit warning about this, e.g. see https://github.com/adobe-fonts/source-han-sans/releases/tag/2.004R. Perhaps this should be included on all their font release pages; it seems a bit haphazard at the moment.)

Blink-based browsers like Chrome work around this by including a copy of FreeType built in to the browser, and using this instead of DirectWrite to render such fonts. Of course, this doesn't come for free; there's a code size and maintenance cost to consider.

Doing the same thing in Firefox would be bug 1403299.

Flags: needinfo?(jfkthame)

(In reply to Jonathan Kew (:jfkthame) from comment #11)

Thanks for explaining that! Do you think it's likely that FreeType will ever get added to Firefox in the future? It looks like bug 1403299 has been sitting dormant for the past few years. ;)

Severity: normal → S3

Changing qe-verify? to qe-verify+.

Flags: qe-verify? → qe-verify+
You need to log in before you can comment on or make changes to this bug.