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

Unified Diff: ui/gfx/font.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 7 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 | « ui/gfx/font.h ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font.cc
diff --git a/ui/gfx/font.cc b/ui/gfx/font.cc
index 60a7acd424f5f12193b30dd2e62ad5440269c0d2..ac7b7491a6cdcb98caa8e889900db693f454d9f6 100644
--- a/ui/gfx/font.cc
+++ b/ui/gfx/font.cc
@@ -41,8 +41,8 @@ Font::Font(const std::string& font_name, int font_size)
Font::~Font() {
}
-Font Font::Derive(int size_delta, int style) const {
- return platform_font_->DeriveFont(size_delta, style);
+Font Font::Derive(int size_delta, int style, Font::Weight weight) const {
+ return platform_font_->DeriveFont(size_delta, style, weight);
}
int Font::GetHeight() const {
@@ -77,6 +77,10 @@ int Font::GetFontSize() const {
return platform_font_->GetFontSize();
}
+Font::Weight Font::GetWeight() const {
+ return platform_font_->GetWeight();
+}
+
const FontRenderParams& Font::GetFontRenderParams() const {
return platform_font_->GetFontRenderParams();
}
@@ -87,4 +91,10 @@ NativeFont Font::GetNativeFont() const {
}
#endif
+#ifndef NDEBUG
+std::ostream& operator<<(std::ostream& stream, const Font::Weight weight) {
+ return stream << static_cast<int>(weight);
+}
+#endif
+
} // namespace gfx
« no previous file with comments | « ui/gfx/font.h ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698