| ... |
... |
@@ -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,
|