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

Unified Diff: ui/gfx/platform_font_linux.h

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_linux.h
diff --git a/ui/gfx/platform_font_linux.h b/ui/gfx/platform_font_linux.h
index 52c4bceb76e82e590d5cd4aaa158a19a29b5b4ad..da5d3445cd6514e59771e21ae6e158e92847e6e9 100644
--- a/ui/gfx/platform_font_linux.h
+++ b/ui/gfx/platform_font_linux.h
@@ -41,8 +41,11 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
#endif
// Overridden from PlatformFont:
- Font DeriveFont(int size_delta, int style) const override;
+ Font DeriveFont(int size_delta,
+ int style,
+ gfx::Font::FontWeight weight) const override;
int GetHeight() override;
+ gfx::Font::FontWeight GetWeight() override;
int GetBaseline() override;
int GetCapHeight() override;
int GetExpectedTextWidth(int length) override;
@@ -59,17 +62,18 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
const std::string& family,
int size_pixels,
int style,
+ gfx::Font::FontWeight weight,
const FontRenderParams& params);
~PlatformFontLinux() override;
// Initializes this object based on the passed-in details. If |typeface| is
// empty, a new typeface will be loaded.
- void InitFromDetails(
- const skia::RefPtr<SkTypeface>& typeface,
- const std::string& font_family,
- int font_size_pixels,
- int style,
- const FontRenderParams& params);
+ void InitFromDetails(const skia::RefPtr<SkTypeface>& typeface,
+ const std::string& font_family,
+ int font_size_pixels,
+ int style,
+ gfx::Font::FontWeight weight,
+ const FontRenderParams& params);
// Initializes this object as a copy of another PlatformFontLinux.
void InitFromPlatformFont(const PlatformFontLinux* other);
@@ -97,6 +101,7 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
int height_pixels_;
int cap_height_pixels_;
double average_width_pixels_;
+ gfx::Font::FontWeight weight_;
#if defined(OS_CHROMEOS)
// A font description string of the format used by gfx::FontList.

Powered by Google App Engine
This is Rietveld 408576698