Closed Bug 1430632 Opened 7 years ago Closed 7 years ago

DirectWrite support for OpenType Font Variations


(Core :: Graphics: Text, enhancement)

Not set



Tracking Status
firefox59 --- fixed


(Reporter: jfkthame, Assigned: jfkthame)


(Blocks 1 open bug)



(2 files)

As of the Win10 Fall Creators Update, there is support for variation fonts via new DirectWrite APIs. So we should be able to implement CSS variation-font support on current Win10 systems fairly easily via the DWrite backend.

This will not work on earlier Windows systems (we'll need to test API availability at runtime), so if we want variation-font support on older systems we'll need to take another approach, e.g. based on bug 1403299.
Depends on: 1430634
This seems to be sufficient to make things work nicely on the axis-praxis test page, for example (with the exception of the Winner font; that looks like a DWrite bug). A followup bug will be needed to hook it all up to webrender, as I didn't tackle that yet.
Attachment #8942709 - Flags: review?(lsalzman)
Assignee: nobody → jfkthame
Depends on: 1430638
Note that the patch here won't currently build on tryserver (or inbound/central), because it depends on bug 1430634 and bug 1430638. Here's a try build where I just hacked in a bunch of the new DirectWrite declarations in a temporary extra header file, to work around this:
Attachment #8942709 - Flags: review?(lsalzman) → review+
AFAICT, this allows us to build successfully with the current toolchains etc., until we're ready to bump the SDK and WINVER settings (at which point it should harmlessly stop getting included, even if we don't remember to rip it out right away). The resulting build still runs happily on Win7, it just won't actually support font variations.
Attachment #8943665 - Flags: review?(nfroyd)
Attachment #8943665 - Flags: review?(lsalzman)
Attachment #8943665 - Flags: review?(lsalzman) → review+
Comment on attachment 8943665 [details] [diff] [review]
Copy declarations of new DirectWrite interfaces into our code so it will build against the current Windows SDK and WINVER settings

Review of attachment 8943665 [details] [diff] [review]:

Thank you!
Attachment #8943665 - Flags: review?(nfroyd) → review+
So just FTR, with the additional patch, this no longer depends on bug 1430638 and bug 1430634; but when we're ready to move forward on those issues, we'll be able to remove the extra header here.
No longer depends on: 1430638, 1430634
Pushed by
Support OpenType variation fonts in the DirectWrite font back-end (on Win10 Fall Creators Update). r=lsalzman
Copy declarations of new DirectWrite interfaces into our code so it will build against the current Windows SDK and WINVER settings. r=lsalzman,froydnj
:jfkthame windows-mingw32-32 debug build-win32-mingw32/debug (B) job got busted on this push:
It's tier2 job but is there any chance you can take a look? Thank you.
Flags: needinfo?(jfkthame)
Ugh, looks like it must be using an older (pre-Win10?) SDK, and doesn't have the dwrite_3.h header at all. I guess we can work around that by copying the necessary declarations into our code, but it may take some trial and error to determine exactly what needs to be included.

Or is it possible to update the SDK those builds are using, so that it matches what we use in the tier-1 builds?
Flags: needinfo?(jfkthame)
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Depends on: 1432009
Works pretty good on Windows 10...but the print-function don't work.
The print-preview shows the variable font, but if you print it out, the printer prints without the font-variable-settings..
Depends on: 1433060
You need to log in before you can comment on or make changes to this bug.