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 c86b14a0c59f95a33c7c8b3b1b95caef0ecc5fa9..4e2f7f497735f2c1957cf1f0763c6d35f016af90 100644 |
--- a/ui/base/l10n/l10n_util_win.cc |
+++ b/ui/base/l10n/l10n_util_win.cc |
@@ -54,14 +54,13 @@ bool IsFontPresent(const wchar_t* font_name) { |
HDC dc = GetDC(0); |
HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont)); |
WCHAR actual_font_name[LF_FACESIZE]; |
- DWORD size_ret = GetTextFace(dc, LF_FACESIZE, actual_font_name); |
- actual_font_name[LF_FACESIZE - 1] = 0; |
+ int size_ret = GetTextFace(dc, LF_FACESIZE, actual_font_name); |
SelectObject(dc, oldFont); |
DeleteObject(hfont); |
ReleaseDC(0, dc); |
// We don't have to worry about East Asian fonts with locale-dependent |
// names here. |
- return wcscmp(font_name, actual_font_name) == 0; |
+ return (size_ret != 0) && wcscmp(font_name, actual_font_name) == 0; |
} |
class OverrideLocaleHolder { |
@@ -154,10 +153,10 @@ bool NeedOverrideDefaultUIFont(base::string16* override_font_family, |
} |
void AdjustUIFont(LOGFONT* logfont) { |
- double dpi_scale = gfx::GetDPIScale(); |
+ float dpi_scale = gfx::GetDPIScale(); |
if (gfx::Display::HasForceDeviceScaleFactor()) { |
// If the scale is forced, we don't need to adjust it here. |
- dpi_scale = 1.0; |
+ dpi_scale = 1.0f; |
} |
AdjustUIFontForDIP(dpi_scale, logfont); |
} |