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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/font.h" 5 #include "ui/gfx/font.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/gfx/platform_font.h" 9 #include "ui/gfx/platform_font.h"
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 Font::Font(const std::string& font_name, int font_size) 36 Font::Font(const std::string& font_name, int font_size)
37 : platform_font_(PlatformFont::CreateFromNameAndSize(font_name, 37 : platform_font_(PlatformFont::CreateFromNameAndSize(font_name,
38 font_size)) { 38 font_size)) {
39 } 39 }
40 40
41 Font::~Font() { 41 Font::~Font() {
42 } 42 }
43 43
44 Font Font::Derive(int size_delta, int style) const { 44 Font Font::Derive(int size_delta,
45 return platform_font_->DeriveFont(size_delta, style); 45 int style,
46 gfx::Font::FontWeight weight) const {
47 return platform_font_->DeriveFont(size_delta, style, weight);
46 } 48 }
47 49
48 int Font::GetHeight() const { 50 int Font::GetHeight() const {
49 return platform_font_->GetHeight(); 51 return platform_font_->GetHeight();
50 } 52 }
51 53
52 int Font::GetBaseline() const { 54 int Font::GetBaseline() const {
53 return platform_font_->GetBaseline(); 55 return platform_font_->GetBaseline();
54 } 56 }
55 57
(...skipping 14 matching lines...) Expand all
70 } 72 }
71 73
72 std::string Font::GetActualFontNameForTesting() const { 74 std::string Font::GetActualFontNameForTesting() const {
73 return platform_font_->GetActualFontNameForTesting(); 75 return platform_font_->GetActualFontNameForTesting();
74 } 76 }
75 77
76 int Font::GetFontSize() const { 78 int Font::GetFontSize() const {
77 return platform_font_->GetFontSize(); 79 return platform_font_->GetFontSize();
78 } 80 }
79 81
82 gfx::Font::FontWeight Font::GetWeight() const {
83 return platform_font_->GetWeight();
84 }
85
80 const FontRenderParams& Font::GetFontRenderParams() const { 86 const FontRenderParams& Font::GetFontRenderParams() const {
81 return platform_font_->GetFontRenderParams(); 87 return platform_font_->GetFontRenderParams();
82 } 88 }
83 89
84 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_IOS) 90 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_IOS)
85 NativeFont Font::GetNativeFont() const { 91 NativeFont Font::GetNativeFont() const {
86 return platform_font_->GetNativeFont(); 92 return platform_font_->GetNativeFont();
87 } 93 }
88 #endif 94 #endif
89 95
90 } // namespace gfx 96 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698