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

Side by Side Diff: ui/gfx/platform_font_win.h

Issue 251773002: PlatformFontWin::DeriveFontWithHeight insensitive to base font's height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PlatformFontWin::DeriveFontWithHeight consistency fix after code review changes Created 6 years, 6 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
« no previous file with comments | « no previous file | ui/gfx/platform_font_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UI_GFX_PLATFORM_FONT_WIN_H_ 5 #ifndef UI_GFX_PLATFORM_FONT_WIN_H_
6 #define UI_GFX_PLATFORM_FONT_WIN_H_ 6 #define UI_GFX_PLATFORM_FONT_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void InitWithFontNameAndSize(const std::string& font_name, 135 void InitWithFontNameAndSize(const std::string& font_name,
136 int font_size); 136 int font_size);
137 137
138 // Returns the base font ref. This should ONLY be invoked on the 138 // Returns the base font ref. This should ONLY be invoked on the
139 // UI thread. 139 // UI thread.
140 static HFontRef* GetBaseFontRef(); 140 static HFontRef* GetBaseFontRef();
141 141
142 // Creates and returns a new HFONTRef from the specified HFONT. 142 // Creates and returns a new HFONTRef from the specified HFONT.
143 static HFontRef* CreateHFontRef(HFONT font); 143 static HFontRef* CreateHFontRef(HFONT font);
144 144
145 // Creates and returns a new HFONTRef from the specified HFONT. Uses provided
146 // |font_metrics| instead of calculating new one.
147 static HFontRef* CreateHFontRef(HFONT font, const TEXTMETRIC& font_metrics);
148
149 // Returns a largest derived Font whose height does not exceed the height of
150 // |base_font|.
151 static Font DeriveWithCorrectedSize(HFONT base_font);
152
145 // Creates a new PlatformFontWin with the specified HFontRef. Used when 153 // Creates a new PlatformFontWin with the specified HFontRef. Used when
146 // constructing a Font from a HFONT we don't want to copy. 154 // constructing a Font from a HFONT we don't want to copy.
147 explicit PlatformFontWin(HFontRef* hfont_ref); 155 explicit PlatformFontWin(HFontRef* hfont_ref);
148 156
149 // Reference to the base font all fonts are derived from. 157 // Reference to the base font all fonts are derived from.
150 static HFontRef* base_font_ref_; 158 static HFontRef* base_font_ref_;
151 159
152 // Indirect reference to the HFontRef, which references the underlying HFONT. 160 // Indirect reference to the HFontRef, which references the underlying HFONT.
153 scoped_refptr<HFontRef> font_ref_; 161 scoped_refptr<HFontRef> font_ref_;
154 162
155 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); 163 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin);
156 }; 164 };
157 165
158 } // namespace gfx 166 } // namespace gfx
159 167
160 #endif // UI_GFX_PLATFORM_FONT_WIN_H_ 168 #endif // UI_GFX_PLATFORM_FONT_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/platform_font_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698