Closed Bug 1533797 Opened 5 years ago Closed 5 years ago

downloadable font: not usable by platform

Categories

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

65 Branch
Unspecified
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla68
Tracking Status
firefox68 --- verified

People

(Reporter: bryanjm, Assigned: jfkthame)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

Steps to reproduce:

Using Firefox in Linux, I opened a document in Microsoft Word Online that had bullet points.

Actual results:

The first and third levels of the bullet points were not properly rendered.

Expected results:

Word Online provides the missing fonts via CSS:

@font-face {
font-family: symbol;
src: url('https://fs.microsoft.com/fs/4.2/rawguids/26522609597');
}
@font-face {
font-family: Courier New_MSFontService;
src: url('https://fs.microsoft.com/fs/4.2/rawguids/38459451639');
}
@font-face {
font-family: Wingdings_MSFontService;
src: url('https://fs.microsoft.com/fs/4.2/rawguids/37798520877');
}

However, Firefox isn't able to load the fonts and the following errors appear in the console:

downloadable font: not usable by platform (font-family: "Wingdings_MSFontService" style:normal weight:400 stretch:100 src index:0) source: https://fs.microsoft.com/fs/4.2/rawguids/37798520877 unknown:15:17
downloadable font: not usable by platform (font-family: "symbol" style:normal weight:400 stretch:100 src index:0) source: https://fs.microsoft.com/fs/4.2/rawguids/26522609597

I've created a minimal test page here to reproduce the issue:

https://bmaupin.github.io/askubuntu-983191-research/test-bullet-points.html

More details on my research as well as a workaround are here:

https://github.com/bmaupin/askubuntu-983191-research#readme

Thanks!

Component: Untriaged → Graphics: Text
OS: Unspecified → Linux
Product: Firefox → Core

Jonathan, any idea why it is failing to load these web fonts?

Flags: needinfo?(jfkthame)
Priority: -- → P3

Hmm, WFM on macOS, so it seems to be specific to the Linux backend. My guess is that it's because those fonts don't have a Unicode 'cmap' table, they're symbol-encoded. This probably causes them to fail when we call FT_Select_Charmap at https://searchfox.org/mozilla-central/rev/b9da45f63cb567244933c77b2c7e827a057d3f9b/gfx/thebes/gfxFcPlatformFontList.cpp#1991, which we do because we don't in general know how to handle random non-Unicode mappings in fonts.

I guess we could fall back to trying FT_ENCODING_MS_SYMBOL if we fail to find an FT_ENCODING_UNICODE mapping, and then this would probably work. We'd need to do that in a bunch of places where we currently just call FT_Select_Charmap(..., FT_ENCODING_UNICODE) and bail out on failure.

Flags: needinfo?(jfkthame)

I suspect something like this will probably resolve the problem; pushed it to try to check whether I broke anything. https://treeherder.mozilla.org/#/jobs?repo=try&revision=dbbdc571fbd9e7413bf9a38d8770ffc8bb887cad

I'll try to reproduce the issue and test the build later, and if all goes well we can consider it for review.

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ad447cf869e2
Let freetype backend fall back to MS_SYMBOL if no UNICODE charmap is available. r=lsalzman
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → jfkthame
Flags: qe-verify+

Hello,
Reproduced the issue using Firefox 67.0a1 (20190308215337) on Ubuntu 18.04.
The issue is verified using Firefox 68.0b13 (20190624133534) and Firefox 69.0a1 (20190624213657) on Ubuntu 18.04.

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

Attachment

General

Creator:
Created:
Updated:
Size: