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

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 352273002: Merge 279589 "Use Consolas for Windows 7 and above as default mo..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
===================================================================
--- chrome/browser/ui/prefs/prefs_tab_helper.cc (revision 279860)
+++ chrome/browser/ui/prefs/prefs_tab_helper.cc (working copy)
@@ -27,6 +27,7 @@
#include "grit/platform_locale_settings.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/uscript.h"
+#include "ui/base/l10n/l10n_util.h"
#include "webkit/common/webpreferences.h"
#if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES)
@@ -129,9 +130,11 @@
#endif // !defined(OS_ANDROID)
#if defined(OS_WIN)
-// On Windows with DirectWrite we want to use an alternate fixed font like
+// On Windows with antialising we want to use an alternate fixed font like
// Consolas, which looks much better than Courier New.
-bool ShouldUseAlternateDefaultFixedFont() {
+bool ShouldUseAlternateDefaultFixedFont(const std::string& script) {
+ if (!StartsWithASCII(script, "courier", false))
+ return false;
UINT smooth_type = 0;
SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smooth_type, 0);
return (base::win::GetVersion() >= base::win::VERSION_WIN7) &&
@@ -473,7 +476,8 @@
#if defined(OS_WIN)
if (pref.pref_name == prefs::kWebKitFixedFontFamily) {
- if (ShouldUseAlternateDefaultFixedFont())
+ if (ShouldUseAlternateDefaultFixedFont(
+ l10n_util::GetStringUTF8(pref.resource_id)))
pref.resource_id = IDS_FIXED_FONT_FAMILY_ALT_WIN;
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698