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

[tor-commits] [Git][tpo/applications/tor-browser][base-browser-147.0a1-16.0-2] fixup! BB 43140: Tighten up fonts on Linux.



Title: GitLab

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

Commits:

  • c2820657
    by Pier Angelo Vendrame at 2026-01-19T16:13:59+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:

Changes:

  • widget/gtk/nsLookAndFeel.cpp
    ... ... @@ -1268,13 +1268,6 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
    1268 1268
                                   gfxFontStyle* aFontStyle) {
    
    1269 1269
       aFontStyle->style = FontSlantStyle::NORMAL;
    
    1270 1270
     
    
    1271
    -#ifdef BASE_BROWSER_VERSION
    
    1272
    -  *aFontName = u"\"Arimo\"";
    
    1273
    -  aFontStyle->systemFont = true;
    
    1274
    -  aFontStyle->weight = FontWeight::NORMAL;
    
    1275
    -  aFontStyle->stretch = FontStretch::NORMAL;
    
    1276
    -  aFontStyle->size = 14;
    
    1277
    -#else
    
    1278 1271
       // As in
    
    1279 1272
       // https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n10333
    
    1280 1273
       PangoFontDescription* desc;
    
    ... ... @@ -1283,6 +1276,16 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
    1283 1276
     
    
    1284 1277
       aFontStyle->systemFont = true;
    
    1285 1278
     
    
    1279
    +#ifdef BASE_BROWSER_VERSION
    
    1280
    +  // tor-browser#44410: Set a few properties (especially the font name), but not
    
    1281
    +  // the size, as strange scale methods might be in use in the system.
    
    1282
    +  // We normalize the font size with RFP anyway, so this should not enable
    
    1283
    +  // fingerprinting.
    
    1284
    +  *aFontName = u"\"Arimo\"";
    
    1285
    +  aFontStyle->systemFont = true;
    
    1286
    +  aFontStyle->weight = FontWeight::NORMAL;
    
    1287
    +  aFontStyle->stretch = FontStretch::NORMAL;
    
    1288
    +#else
    
    1286 1289
       constexpr auto quote = u"\""_ns;
    
    1287 1290
       NS_ConvertUTF8toUTF16 family(pango_font_description_get_family(desc));
    
    1288 1291
       *aFontName = quote + family + quote;
    
    ... ... @@ -1292,6 +1295,7 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
    1292 1295
     
    
    1293 1296
       // FIXME: Set aFontStyle->stretch correctly!
    
    1294 1297
       aFontStyle->stretch = FontStretch::NORMAL;
    
    1298
    +#endif
    
    1295 1299
     
    
    1296 1300
       float size = float(pango_font_description_get_size(desc)) / PANGO_SCALE;
    
    1297 1301
     
    
    ... ... @@ -1309,7 +1313,6 @@ static void GetSystemFontInfo(GtkStyleContext* aStyle, nsString* aFontName,
    1309 1313
       aFontStyle->size = size;
    
    1310 1314
     
    
    1311 1315
       pango_font_description_free(desc);
    
    1312
    -#endif
    
    1313 1316
     }
    
    1314 1317
     
    
    1315 1318
     bool nsLookAndFeel::NativeGetFont(FontID aID, nsString& aFontName,
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx