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

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: 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/platform_font_ios.mm ('k') | ui/gfx/platform_font_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_linux.h
diff --git a/ui/gfx/platform_font_linux.h b/ui/gfx/platform_font_linux.h
index e9289b6da81e020114fbd938bbfed4b841e30d6c..fefa2667f42bcfcd491966747b52e9b4379c49b9 100644
--- a/ui/gfx/platform_font_linux.h
+++ b/ui/gfx/platform_font_linux.h
@@ -23,7 +23,7 @@ namespace gfx {
class GFX_EXPORT PlatformFontLinux : public PlatformFont {
public:
// TODO(derat): Get rid of the default constructor in favor of using
- // gfx::FontList (which also has the concept of a default font but may contain
+ // FontList (which also has the concept of a default font but may contain
// multiple font families) everywhere. See http://crbug.com/398885#c16.
PlatformFontLinux();
PlatformFontLinux(const std::string& font_name, int font_size_pixels);
@@ -34,14 +34,17 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
static void ReloadDefaultFont();
#if defined(OS_CHROMEOS)
- // Sets the default font. |font_description| is a gfx::FontList font
- // description; only the first family will be used.
+ // Sets the default font. |font_description| is a FontList font description;
+ // only the first family will be used.
static void SetDefaultFontDescription(const std::string& font_description);
#endif
// Overridden from PlatformFont:
- Font DeriveFont(int size_delta, int style) const override;
+ Font DeriveFont(int size_delta,
+ int style,
+ Font::Weight weight) const override;
int GetHeight() override;
+ Font::Weight GetWeight() const override;
int GetBaseline() override;
int GetCapHeight() override;
int GetExpectedTextWidth(int length) override;
@@ -57,7 +60,8 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
PlatformFontLinux(sk_sp<SkTypeface> typeface,
const std::string& family,
int size_pixels,
- int style,
+ bool italic,
+ Font::Weight weight,
const FontRenderParams& params);
~PlatformFontLinux() override;
@@ -67,7 +71,8 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
sk_sp<SkTypeface> typeface,
const std::string& font_family,
int font_size_pixels,
- int style,
+ bool italic,
+ Font::Weight weight,
const FontRenderParams& params);
// Initializes this object as a copy of another PlatformFontLinux.
@@ -82,7 +87,7 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
// Skia actually expects a family name and not a font name.
std::string font_family_;
int font_size_pixels_;
- int style_;
+ bool italic_;
float device_scale_factor_;
// Information describing how the font should be rendered.
@@ -94,9 +99,10 @@ class GFX_EXPORT PlatformFontLinux : public PlatformFont {
int height_pixels_;
int cap_height_pixels_;
double average_width_pixels_;
+ Font::Weight weight_;
#if defined(OS_CHROMEOS)
- // A font description string of the format used by gfx::FontList.
+ // A font description string of the format used by FontList.
static std::string* default_font_description_;
#endif
« no previous file with comments | « ui/gfx/platform_font_ios.mm ('k') | ui/gfx/platform_font_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698