Bug 1692498 - Let the emoji font pref override Unicode presentation style only if it's explicitly user-set. r=emk

Differential Revision: https://phabricator.services.mozilla.com/D105102
This commit is contained in:
Jonathan Kew 2021-02-15 20:11:17 +00:00
Родитель 716b516708
Коммит 1260865663
4 изменённых файлов: 9 добавлений и 15 удалений

Просмотреть файл

@ -3329,12 +3329,14 @@ gfxFont* gfxFontGroup::FindFontForChar(uint32_t aCh, uint32_t aPrevCh,
// 2. search pref fonts
gfxFont* font = WhichPrefFontSupportsChar(aCh, aNextCh, presentation);
if (font) {
if (PrefersColor(presentation)) {
// For emoji, always accept the font from preferences even if it isn't
// actually a color-emoji font, as some users may explicitly choose to
// set their emoji font preference to a monochrome font like Symbola.
// So the font.name-list.emoji preference takes precedence over the
// Unicode presentation style here.
if (PrefersColor(presentation) &&
Preferences::HasUserValue("font.name-list.emoji")) {
// For emoji, always accept the font from preferences if it's explicitly
// user-set, even if it isn't actually a color-emoji font, as some users
// may want to set their emoji font preference to a monochrome font like
// Symbola.
// So a user-provided font.name-list.emoji preference takes precedence
// over the Unicode presentation style here.
RefPtr<gfxFont> autoRefDeref(candidateFont);
*aMatchType = FontMatchType::Kind::kPrefsFallback;
return font;

Просмотреть файл

@ -3,10 +3,6 @@
<meta charset=utf-8>
<style>
span {
/* On Windows, we need to use the TwEmoji Mozilla font in preference to
Segoe UI Emoji, as the latter doesn't support the Regional-Indicator
flag ligatures. */
font-family: TwEmoji Mozilla, sans-serif;
font-size: 36px;
font-kerning: none;
}

Просмотреть файл

@ -3,10 +3,6 @@
<meta charset=utf-8>
<style>
span {
/* On Windows, we need to use the TwEmoji Mozilla font in preference to
Segoe UI Emoji, as the latter doesn't support the Regional-Indicator
flag ligatures. */
font-family: TwEmoji Mozilla, sans-serif;
font-size: 36px;
font-kerning: none;
}

Просмотреть файл

@ -1,6 +1,6 @@
# Font-dependent reftests may fail intermittently/transiently due to asynch fallback,
# so we disable the async mechanism for this directory.
defaults pref(gfx.font_rendering.fallback.async,false)
defaults pref(gfx.font_rendering.fallback.async,false) pref(gfx.bundled-fonts.activate,1)
fails-if(Android) == fallback-01.xhtml fallback-01-ref.xhtml
== font-selection-by-lang-01.html font-selection-by-lang-01-ref.html