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

Unified Diff: ui/gfx/platform_font.h

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for review issues. Created 4 years, 9 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
Index: ui/gfx/platform_font.h
diff --git a/ui/gfx/platform_font.h b/ui/gfx/platform_font.h
index 58b0083c38626bac38000379e5f839016be92e4e..12ed502c3c52c960ea9506c447299815ff77d284 100644
--- a/ui/gfx/platform_font.h
+++ b/ui/gfx/platform_font.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
+#include "ui/gfx/font.h"
#include "ui/gfx/gfx_export.h"
#include "ui/gfx/native_widget_types.h"
@@ -33,8 +34,11 @@ class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> {
// Returns a new Font derived from the existing font.
// |size_delta| is the size in pixels to add to the current font.
// The style parameter specifies the new style for the font, and is a
- // bitmask of the values: BOLD, ITALIC and UNDERLINE.
- virtual Font DeriveFont(int size_delta, int style) const = 0;
+ // bitmask of the values: ITALIC and UNDERLINE.
+ // The weight parameter specifies the desired weight of the font.
+ virtual Font DeriveFont(int size_delta,
+ int style,
+ gfx::Font::Weight weight) const = 0;
// Returns the number of vertical pixels needed to display characters from
// the specified font. This may include some leading, i.e. height may be
@@ -43,6 +47,9 @@ class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> {
// need to be revisited in the future.
virtual int GetHeight() = 0;
+ // Returns the font weight.
+ virtual gfx::Font::Weight GetWeight() = 0;
+
// Returns the baseline, or ascent, of the font.
virtual int GetBaseline() = 0;

Powered by Google App Engine
This is Rietveld 408576698