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

Side by Side Diff: app/gfx/font.h

Issue 113443: ChromeCanvas->gfx::Canvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « app/gfx/chrome_font_win.cc ('k') | app/gfx/font_gtk.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 APP_GFX_FONT_H_ 5 #ifndef APP_GFX_FONT_H_
6 #define APP_GFX_FONT_H_ 6 #define APP_GFX_FONT_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <string> 10 #include <string>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 NativeFont nativeFont() const; 104 NativeFont nativeFont() const;
105 105
106 // Creates a font with the default name and style. 106 // Creates a font with the default name and style.
107 Font(); 107 Font();
108 108
109 #if defined(OS_WIN) 109 #if defined(OS_WIN)
110 // Creates a Font from the specified HFONT. The supplied HFONT is effectively 110 // Creates a Font from the specified HFONT. The supplied HFONT is effectively
111 // copied. 111 // copied.
112 static Font CreateFont(HFONT hfont); 112 static Font CreateFont(HFONT hfont);
113 113
114 // Returns the handle to the underlying HFONT. This is used by ChromeCanvas to 114 // Returns the handle to the underlying HFONT. This is used by gfx::Canvas to
115 // draw text. 115 // draw text.
116 HFONT hfont() const { return font_ref_->hfont(); } 116 HFONT hfont() const { return font_ref_->hfont(); }
117 117
118 // Dialog units to pixels conversion. 118 // Dialog units to pixels conversion.
119 // See http://support.microsoft.com/kb/145994 for details. 119 // See http://support.microsoft.com/kb/145994 for details.
120 int horizontal_dlus_to_pixels(int dlus) { 120 int horizontal_dlus_to_pixels(int dlus) {
121 return dlus * font_ref_->dlu_base_x() / 4; 121 return dlus * font_ref_->dlu_base_x() / 4;
122 } 122 }
123 int vertical_dlus_to_pixels(int dlus) { 123 int vertical_dlus_to_pixels(int dlus) {
124 return dlus * font_ref_->height() / 8; 124 return dlus * font_ref_->height() / 8;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 int height_; 230 int height_;
231 int ascent_; 231 int ascent_;
232 int avg_width_; 232 int avg_width_;
233 #endif 233 #endif
234 234
235 }; 235 };
236 236
237 } // namespace gfx 237 } // namespace gfx
238 238
239 #endif // APP_GFX_FONT_H_ 239 #endif // APP_GFX_FONT_H_
OLDNEW
« no previous file with comments | « app/gfx/chrome_font_win.cc ('k') | app/gfx/font_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698