Bug 1803406 - Activate supplementary fonts in all processes, to ensure consistent font lists across macOS processes. r=gfx-reviewers,lsalzman

Removed the use of kCTFontOptionsPreferSystemFont that was in the previous version
of this patch, given the issues we saw in bug 1858869 -- that option appears to be
much too aggressive about using system fonts rather than user-installed ones. So
we retain only the gfxPlatformMac font-activation change.

Differential Revision: https://phabricator.services.mozilla.com/D170286
This commit is contained in:
Jonathan Kew 2023-11-07 16:01:18 +00:00
parent 6190eb5201
commit 40dd8e5176

View File

@ -74,12 +74,21 @@ PRThread* gfxPlatformMac::sFontRegistrationThread = nullptr;
our font list. */
/* static */
void gfxPlatformMac::RegisterSupplementalFonts() {
// On Catalina+, it appears to be sufficient to activate fonts in the parent
// process; they are then also usable in child processes.
if (XRE_IsParentProcess()) {
sFontRegistrationThread = PR_CreateThread(
PR_USER_THREAD, FontRegistrationCallback, nullptr, PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
switch (XRE_GetProcessType()) {
case GeckoProcessType_Default:
case GeckoProcessType_Content:
// TODO: figure out if this matters to any other processes (e.g. GPU?)
//
// We activate the fonts on a separate thread, to minimize the startup-
// time cost.
sFontRegistrationThread = PR_CreateThread(
PR_USER_THREAD, FontRegistrationCallback, nullptr, PR_PRIORITY_NORMAL,
PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
break;
default:
// Assume other process types don't actually need the full font list.
break;
}
}