Pier Angelo Vendrame pushed to branch mullvad-browser-147.0a1-16.0-2 at The Tor 
Project / Applications / Mullvad Browser


Commits:
c43f2216 by Pier Angelo Vendrame at 2026-01-19T16:14:40+01:00
fixup! BB 43140: Tighten up fonts on Linux.

BB 44410: Use UI system font size.

After tor-browser#44286, the browser UI font size is too small in some
system.
So, hardcode only a few properties, but still query the system for the
font size.

- - - - -


1 changed file:

- widget/gtk/nsLookAndFeel.cpp


Changes:

=====================================
widget/gtk/nsLookAndFeel.cpp
=====================================
@@ -1268,13 +1268,6 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, 
nsString* aFontName,
                               gfxFontStyle* aFontStyle) {
   aFontStyle->style = FontSlantStyle::NORMAL;
 
-#ifdef BASE_BROWSER_VERSION
-  *aFontName = u"\"Arimo\"";
-  aFontStyle->systemFont = true;
-  aFontStyle->weight = FontWeight::NORMAL;
-  aFontStyle->stretch = FontStretch::NORMAL;
-  aFontStyle->size = 14;
-#else
   // As in
   // https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n10333
   PangoFontDescription* desc;
@@ -1283,6 +1276,16 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, 
nsString* aFontName,
 
   aFontStyle->systemFont = true;
 
+#ifdef BASE_BROWSER_VERSION
+  // tor-browser#44410: Set a few properties (especially the font name), but 
not
+  // the size, as strange scale methods might be in use in the system.
+  // We normalize the font size with RFP anyway, so this should not enable
+  // fingerprinting.
+  *aFontName = u"\"Arimo\"";
+  aFontStyle->systemFont = true;
+  aFontStyle->weight = FontWeight::NORMAL;
+  aFontStyle->stretch = FontStretch::NORMAL;
+#else
   constexpr auto quote = u"\""_ns;
   NS_ConvertUTF8toUTF16 family(pango_font_description_get_family(desc));
   *aFontName = quote + family + quote;
@@ -1292,6 +1295,7 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, 
nsString* aFontName,
 
   // FIXME: Set aFontStyle->stretch correctly!
   aFontStyle->stretch = FontStretch::NORMAL;
+#endif
 
   float size = float(pango_font_description_get_size(desc)) / PANGO_SCALE;
 
@@ -1309,7 +1313,6 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, 
nsString* aFontName,
   aFontStyle->size = size;
 
   pango_font_description_free(desc);
-#endif
 }
 
 bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName,



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/c43f2216cc3e979b9dc5a5ca353207f440913eb9

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/c43f2216cc3e979b9dc5a5ca353207f440913eb9
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tor-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to