[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] branch tor-browser-91.10.0esr-11.5-1 updated: Bug 41043: Hardcode the UI font on Linux



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch tor-browser-91.10.0esr-11.5-1
in repository tor-browser.

The following commit(s) were added to refs/heads/tor-browser-91.10.0esr-11.5-1 by this push:
     new 9a8642eb27271 Bug 41043: Hardcode the UI font on Linux
9a8642eb27271 is described below

commit 9a8642eb27271502d2b37901aa92a6c0a06b2e76
Author: Pier Angelo Vendrame <pierov@xxxxxxxxxxxxxx>
AuthorDate: Wed Jul 6 22:06:01 2022 +0200

    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).
---
 gfx/thebes/gfxFcPlatformFontList.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp
index 1cd465119da1b..9fa55ffa28f1b 100644
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1992,10 +1992,12 @@ void gfxFcPlatformFontList::GetFontList(nsAtom* aLangGroup,
 
 FontFamily gfxFcPlatformFontList::GetDefaultFontForPlatform(
     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.
+  // 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(
-      "-moz-default"_ns, aLanguage ? aLanguage : nsGkAtoms::x_western);
+      "Arimo"_ns, aLanguage ? aLanguage : nsGkAtoms::x_western);
   NS_ASSERTION(prefFonts, "null list of generic fonts");
   if (prefFonts && !prefFonts->IsEmpty()) {
     return (*prefFonts)[0];

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits