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

Unified Diff: app/resource_bundle.cc

Issue 5180002: Adjust default font sizes for new hand hinted fonts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - textbutton header Created 10 years, 1 month 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 | build/build_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/resource_bundle.cc
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index 859f9a8301206b09cd59168686776071372eb5cc..ab3460956ee0c23d2512f5651f5314d703abee30 100644
--- a/app/resource_bundle.cc
+++ b/app/resource_bundle.cc
@@ -13,6 +13,21 @@
#include "gfx/font.h"
#include "third_party/skia/include/core/SkBitmap.h"
+namespace {
+
+// Font sizes relative to base font.
+#if defined(OS_CHROMEOS) && defined(CROS_FONTS_USING_BCI)
+const int kSmallFontSizeDelta = -3;
+const int kMediumFontSizeDelta = 2;
+const int kLargeFontSizeDelta = 7;
+#else
+const int kSmallFontSizeDelta = -2;
+const int kMediumFontSizeDelta = 3;
+const int kLargeFontSizeDelta = 8;
+#endif
+
+} // namespace
+
ResourceBundle* ResourceBundle::g_shared_instance_ = NULL;
/* static */
@@ -175,17 +190,18 @@ void ResourceBundle::LoadFontsIfNecessary() {
base_font_->DeriveFont(0, base_font_->GetStyle() | gfx::Font::BOLD);
small_font_.reset(new gfx::Font());
- *small_font_ = base_font_->DeriveFont(-2);
+ *small_font_ = base_font_->DeriveFont(kSmallFontSizeDelta);
medium_font_.reset(new gfx::Font());
- *medium_font_ = base_font_->DeriveFont(3);
+ *medium_font_ = base_font_->DeriveFont(kMediumFontSizeDelta);
medium_bold_font_.reset(new gfx::Font());
*medium_bold_font_ =
- base_font_->DeriveFont(3, base_font_->GetStyle() | gfx::Font::BOLD);
+ base_font_->DeriveFont(kMediumFontSizeDelta,
+ base_font_->GetStyle() | gfx::Font::BOLD);
large_font_.reset(new gfx::Font());
- *large_font_ = base_font_->DeriveFont(8);
+ *large_font_ = base_font_->DeriveFont(kLargeFontSizeDelta);
}
}
« no previous file with comments | « no previous file | build/build_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698