Closed Bug 1554208 Opened 6 years ago Closed 5 years ago

Implement FT2 backend for the cross-process shared font list

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

(Whiteboard: [layout:backlog:2019q3])

Attachments

(6 files)

In bug 1514869, an initial implementation of the shared font list landed for desktop platforms. This bug is for adding support to gfxFT2FontList, so that it will be available in Fenix as well.

Whiteboard: [layout:backlog:2019q3]

This isn't really specific to the FT2 fontlist, it's a general fixup that I noticed while
working on this. (The missing checks aren't crucial, but mean that we might re-read a cmap
when we shouldn't need to.)

A bit of cleanup of the existing code, before we start actually implementing new stuff.

Depends on D36106

This makes the functional structure a bit cleaner, so that it'll be easier to slip in the alternative
codepath for the shared font-list.

Depends on D36107

I'll need to add a couple of extra fields to the cache records, and realized that the current format
looks really fragile; in theory, it'd break if a font name ever contained a comma or semicolon
(unlikely though that may be). So let's fix it to be a bit more robust before we add to it further.
Using control characters from the C0 range to delimit fields/records, instead of ASCII punctuation,
removes the (tiny) risk of conflict with characters that actually occur in a name, and using
distinct field and record separators means that we can better check that the records we're loading
from the cache actually match the expected format.

(Given that the startup cache gets re-created when the build ID is updated, a change in the format
between versions wasn't going to cause problems for users; their old cache just gets blown away
when upgrading. Still, a little more robustness seems like a good thing.)

Depends on D36108

This is the main part of the implementation, except that it doesn't handle populating the
local names table (for @font-face src:local() lookups) with Full and PostScript names;
that follows in the next patch.

Depends on D36109

And with this, all tests pass on tryserver when the shared list is enabled.

Depends on D36110

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b610a6988076 patch 1 - Add missing checks for shared charmap. r=jwatt https://hg.mozilla.org/integration/autoland/rev/3e824f3e3c9c patch 2 - Remove redundant member-reset code from gfxFT2FontList::FindFonts (already handled by gfxPlatformFontList before this is called). r=jwatt https://hg.mozilla.org/integration/autoland/rev/f72e750ec20d patch 3 - Rearrange gfxFT2Fonts code so that FindFonts() does just what it says, and other work is handled by the caller. r=jwatt https://hg.mozilla.org/integration/autoland/rev/3e6c11ef906c patch 4 - Make the FontNameCache that we use to store the font list in the startupCache use a more robust and extensible serialization. r=jwatt https://hg.mozilla.org/integration/autoland/rev/7bd8be02631a patch 5 - Implement shared-fontlist support in the gfxFT2FontList backend. r=jwatt https://hg.mozilla.org/integration/autoland/rev/14b2c3daeaf0 patch 6 - Add PSName and FullName support to gfxFT2FontList shared font-list initialization, so that src:local() lookups will work. r=jwatt
Flags: needinfo?(jkew) → needinfo?(jfkthame)
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/58dce111eb0c patch 1 - Add missing checks for shared charmap. r=jwatt https://hg.mozilla.org/integration/autoland/rev/54c09f3cf6d6 patch 2 - Remove redundant member-reset code from gfxFT2FontList::FindFonts (already handled by gfxPlatformFontList before this is called). r=jwatt https://hg.mozilla.org/integration/autoland/rev/0efb6fa15fb7 patch 3 - Rearrange gfxFT2Fonts code so that FindFonts() does just what it says, and other work is handled by the caller. r=jwatt https://hg.mozilla.org/integration/autoland/rev/bb4682a23c79 patch 4 - Make the FontNameCache that we use to store the font list in the startupCache use a more robust and extensible serialization. r=jwatt https://hg.mozilla.org/integration/autoland/rev/8453b0c76891 patch 5 - Implement shared-fontlist support in the gfxFT2FontList backend. r=jwatt https://hg.mozilla.org/integration/autoland/rev/3261c2a5d165 patch 6 - Add PSName and FullName support to gfxFT2FontList shared font-list initialization, so that src:local() lookups will work. r=jwatt
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/ea16d55620de update test expectations for unexpected passes on Android. a=unexpected-pass-fixes

(In reply to Pulsebot from comment #10)

Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/ea16d55620de
update test expectations for unexpected passes on Android.
a=unexpected-pass-fixes

Thanks for this! So try with "-u all" doesn't run web-platform-tests on Android, huh?

(I assume the reason for the new passes here is that we now properly maintain the original form of the font-family name as declared in CSS, and hence "Ahem" now matches our special-case code for disabling antialiasing during these tests; previously it was getting lowercased and slipping through.)

Flags: needinfo?(jfkthame)
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e793ca066f2 Revert expectation for font-matching-rule-009.xht because of permafails. a=testonly
Assignee: nobody → jfkthame
Depends on: 1659257
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: