Closed Bug 1433098 Opened 7 years ago Closed 7 years ago

Don't rename downloaded fonts when using DirectWrite backend

Categories

(Core :: Graphics: Text, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

Currently, when we use a downloaded @font-face resource, the DirectWrite backend (gfxDWriteFontList::MakePlatformFont) will rename the font, replacing the 'name' table in the sfnt resource with a newly-synthesized version. AFAICS, this behavior was inherited from the older GDI-based code, where it was necessary to avoid confusion with a system-installed font that might have the same name. However, under DW it is unnecessary, as instantiating fonts from the gfxFontEntry does not depend on the name; and this renaming behavior -- which only provides the basic "required" names such as Family, Style, PSName in the new name table, so any additional names that were in the original resource are lost -- means that we cannot get correct names for OpenType variation axes or instances; IDWriteFontResource::GetAxisNames ends up returning an empty string list, because of our fake name table. So we should simply remove this renaming from the DW font code.
This avoids a bit of unnecessary work, and (more importantly) is required so that the devtools font-variations API (bug 1323743) will be able to return names from the font correctly.
Attachment #8945731 - Flags: review?(lsalzman)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8945731 - Flags: review?(lsalzman) → review?(jmuizelaar)
Attachment #8945731 - Flags: review?(jmuizelaar) → review+
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/0cd5065a76e9 Don't rename downloaded fonts (replacing the original 'name' table) when using DirectWrite backend. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: