Skip to content
Snippets Groups Projects
Verified Commit a72df0ec authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 41043: Hardcode the UI font on Linux

The mechanism to choose the UI font does not play well with our
fontconfig configuration. As a result, the final criterion to choose
the font for the UI was its version.

Since we hardcode Arimo as a default sans-serif on preferences, we use
it also for the UI. FontConfig will fall back to some other font for
scripts Arimo does not cover as expected (we tested with Japanese).
parent 3d7617e5
No related branches found
No related tags found
2 merge requests!1202Bug_43099: 2024 YEC Strings,!1136Bug 43085: Rebased alpha onto 128.2.0esr
......@@ -2189,11 +2189,12 @@ void gfxFcPlatformFontList::GetFontList(nsAtom* aLangGroup,
FontFamily gfxFcPlatformFontList::GetDefaultFontForPlatform(
nsPresContext* aPresContext, const gfxFontStyle* aStyle,
nsAtom* aLanguage) {
// Get the default font by using a fake name to retrieve the first
// scalable font that fontconfig suggests for the given language.
PrefFontList* prefFonts =
FindGenericFamilies(aPresContext, "-moz-default"_ns,
aLanguage ? aLanguage : nsGkAtoms::x_western);
// We hardcode Arimo also in preferences, and using the original code that
// tried to resolve a non-existing font did not play well with our fontconfig
// configuration. See
// https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41043
PrefFontList* prefFonts = FindGenericFamilies(
aPresContext, "Arimo"_ns, aLanguage ? aLanguage : nsGkAtoms::x_western);
NS_ASSERTION(prefFonts, "null list of generic fonts");
if (prefFonts && !prefFonts->IsEmpty()) {
return (*prefFonts)[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment