summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 20:57:18 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 20:57:18 +0000
commit068ea4cad37cf0cfd309f5dd5f9623a9c590ae35 (patch)
tree7957093405a846fa254a8f250b1a17646228dd8d /app
parent9b511537cfc34a2bda36f9298b270b1768c78e3a (diff)
downloadchromium_src-068ea4cad37cf0cfd309f5dd5f9623a9c590ae35.zip
chromium_src-068ea4cad37cf0cfd309f5dd5f9623a9c590ae35.tar.gz
chromium_src-068ea4cad37cf0cfd309f5dd5f9623a9c590ae35.tar.bz2
[cros] Adjust default font sizes for new hand hinted fonts.
BUG=chromium-os:8658 TEST=Manual. Review URL: http://codereview.chromium.org/5180002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/resource_bundle.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index 859f9a83..ab34609 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);
}
}