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

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

Issue 351523006: Use Consolas for Windows 7 and above as default monospace font (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check for courier 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
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index 7475164f3745111ba0c574911be3725645a8198c..fc8ff3a5658ffe11f312579fe5cdef1436aee20e 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -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 @@ void RegisterFontFamilyMapObserver(
#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 @@ void PrefsTabHelper::RegisterProfilePrefs(
#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