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

Unified Diff: ui/gfx/platform_font_mac.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_linux_unittest.cc ('k') | ui/gfx/platform_font_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_mac.h
diff --git a/ui/gfx/platform_font_mac.h b/ui/gfx/platform_font_mac.h
index 66ffc40bd58241ba2d58b983cc48c1bcb59a2fdd..63a0cbd2bbf05d8aa94ea46e661d77a13df3212e 100644
--- a/ui/gfx/platform_font_mac.h
+++ b/ui/gfx/platform_font_mac.h
@@ -21,8 +21,11 @@ class PlatformFontMac : public PlatformFont {
int font_size);
// 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;
@@ -34,7 +37,10 @@ class PlatformFontMac : public PlatformFont {
NativeFont GetNativeFont() const override;
private:
- PlatformFontMac(const std::string& font_name, int font_size, int font_style);
+ PlatformFontMac(const std::string& font_name,
+ int font_size,
+ int font_style,
+ Font::Weight font_weight);
~PlatformFontMac() override;
// Calculates and caches the font metrics and inits |render_params_|.
@@ -51,6 +57,7 @@ class PlatformFontMac : public PlatformFont {
std::string font_name_; // Corresponds to -[NSFont fontFamily].
int font_size_;
int font_style_;
+ Font::Weight font_weight_;
// Cached metrics, generated in CalculateMetrics().
int height_;
« no previous file with comments | « ui/gfx/platform_font_linux_unittest.cc ('k') | ui/gfx/platform_font_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698