Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1286)

Unified Diff: ui/base/l10n/l10n_util_win.cc

Issue 2695523002: Fix font sizes being incorrect when using --force-device-scale-factor. (Closed)
Patch Set: adjust comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/l10n/l10n_util_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/l10n_util_win.cc
diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc
index cd5b519d1de9bf4553f5476d0b471773ef8d7096..9b61030b9a0dd8ceb773f3015510ecd969be762d 100644
--- a/ui/base/l10n/l10n_util_win.cc
+++ b/ui/base/l10n/l10n_util_win.cc
@@ -155,12 +155,10 @@ bool NeedOverrideDefaultUIFont(base::string16* override_font_family,
}
void AdjustUIFont(LOGFONT* logfont) {
- float dpi_scale = display::win::GetDPIScale();
- if (display::Display::HasForceDeviceScaleFactor()) {
- // If the scale is forced, we don't need to adjust it here.
- dpi_scale = 1.0f;
- }
- AdjustUIFontForDIP(dpi_scale, logfont);
+ // Use the unforced scale so the font will be normalized to the correct DIP
+ // value. That way it'll appear the right size when the forced scale is
+ // applied later (when coverting to pixels).
+ AdjustUIFontForDIP(display::win::GetUnforcedDeviceScaleFactor(), logfont);
robliao 2017/02/13 17:57:33 Just to make sure I understand this correctly, the
Bret 2017/02/14 20:29:20 Our font system works in DIPs, as expected. This v
robliao 2017/02/14 20:43:09 That's fun. I think what I meant to say is let's p
}
void AdjustUIFontForDIP(float dpi_scale, LOGFONT* logfont) {
« no previous file with comments | « no previous file | ui/base/l10n/l10n_util_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698