Bug 1777902 don't change the size of system fonts when ui.textScaleFactor is set r=emilio

Depends on D150930

Differential Revision: https://phabricator.services.mozilla.com/D151111
This commit is contained in:
Karl Tomlinson 2022-07-07 10:22:32 +00:00
parent e632bec9e0
commit 54571ce8b0
2 changed files with 7 additions and 2 deletions

View File

@ -7654,6 +7654,8 @@
# on Mac). If browser.display.os-zoom-behavior == 1, then a positive value
# will be multiplied by the text scale factor; otherwise a positive value is
# used as-is. This controls the size of a CSS "px" at 100% full-zoom.
# The size of system fonts is also changed in proportion with the change in
# "px" sizes. Use "ui.textScaleFactor" instead to only change the size of "px".
# This is only used for windows on the screen, not for printing.
- name: layout.css.devPixelsPerPx
type: AtomicFloat

View File

@ -1094,8 +1094,11 @@ bool nsLookAndFeel::PerThemeData::GetFont(FontID aID, nsString& aFontName,
break;
}
// Convert gdk pixels to CSS pixels.
aFontStyle.size /= gfxPlatformGtk::GetFontScaleFactor();
// Convert GDK pixels to CSS pixels.
// When "layout.css.devPixelsPerPx" > 0, this is not a direct conversion.
// The difference produces a scaling of system fonts in proportion with
// other scaling from the change in CSS pixel sizes.
aFontStyle.size /= LookAndFeel::GetTextScaleFactor();
return true;
}