Closed Bug 1271536 Opened 8 years ago Closed 8 years ago

gfxDWriteFontEntry::CopyFontTable() produce different CMAP table for FirefoxEmoji.ttf when loaded as a bundle or remotely

Categories

(Core :: Graphics: Text, defect, P2)

x86_64
Windows 8
defect

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: timdream, Assigned: jfkthame)

References

()

Details

(Whiteboard: gfx-noted)

Attachments

(1 file)

With patch from bug 1231701 and with bug 1270878 fixed, Firefox thinks FirefoxEmoji.tff does not come with Emoji characters. This happens on all Windows w/ DWrite font rendering.

With breakpoint and observing how the exact same font are being loaded remotely from mozilla.github.io, here [1], so far I can tell cmapLen is 0x0be2 when remotely loaded, and 0x249e when locally loaded.

[1] https://dxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxDWriteFontList.cpp#553

(I don't really know if I am on the right track ...)
(Originally reported as bug 1270878 comment 3)
Blocks: 1231701
No longer blocks: 1270878
Whiteboard: gfx-noted
This happens because the code in gfxDWriteFontEntry::CopyFontTable that uses GDI calls to read font table data will fail for bundled fonts, because they're not known to GDI (they haven't been loaded through AddFontResourceExW, as gfxGDIFontList would have done). So I suspect we end up getting font tables from some "random" fallback font such as Arial instead of the correct tables. Yuck!

You can confirm this by setting gfx.font_rendering.directwrite.use_gdi_table_loading to false, and restarting the browser; the bundled font should then work properly.

I think this is straightforward to fix; just going to test a patch locally.
Assignee: nobody → jfkthame
I believe this should fix the problem you're seeing; works OK in my local testing, at least.
Attachment #8751003 - Flags: feedback?(timdream)
Comment on attachment 8751003 [details] [diff] [review]
Don't try to use GDI table access for bundled fonts when running with the DWrite backend

Works locally on Windows 8. Thank you!

Pushed to try with other patches:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=651b53418aeb
Attachment #8751003 - Flags: feedback?(timdream) → feedback+
Attachment #8751003 - Flags: review?(bas)
Attachment #8751003 - Flags: review?(bas) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/37e781ba0cbf5c79c747ac1d6f6da9a640972bdc
Bug 1271536 - Don't try to use GDI table access for bundled fonts when running with the DWrite backend. r=bas
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/37e781ba0cbf
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: