| OLD | NEW |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Returns a new Font derived from the existing font. | 68 // Returns a new Font derived from the existing font. |
| 69 // size_delta is the size to add to the current font. See the single | 69 // size_delta is the size to add to the current font. See the single |
| 70 // argument version of this method for an example. | 70 // argument version of this method for an example. |
| 71 // The style parameter specifies the new style for the font, and is a | 71 // The style parameter specifies the new style for the font, and is a |
| 72 // bitmask of the values: BOLD, ITALIC and UNDERLINED. | 72 // bitmask of the values: BOLD, ITALIC and UNDERLINED. |
| 73 Font DeriveFont(int size_delta, int style) const; | 73 Font DeriveFont(int size_delta, int style) const; |
| 74 | 74 |
| 75 // Returns the number of vertical pixels needed to display characters from | 75 // Returns the number of vertical pixels needed to display characters from |
| 76 // the specified font. | 76 // the specified font. This may include some leading, i.e. height may be |
| 77 // greater than just ascent + descent. Specifically, the Windows and Mac |
| 78 // implementations include leading and the Linux one does not. This may |
| 79 // need to be revisited in the future. |
| 77 int height() const; | 80 int height() const; |
| 78 | 81 |
| 79 // Returns the baseline, or ascent, of the font. | 82 // Returns the baseline, or ascent, of the font. |
| 80 int baseline() const; | 83 int baseline() const; |
| 81 | 84 |
| 82 // Returns the average character width for the font. | 85 // Returns the average character width for the font. |
| 83 int ave_char_width() const; | 86 int ave_char_width() const; |
| 84 | 87 |
| 85 // Returns the number of horizontal pixels needed to display the specified | 88 // Returns the number of horizontal pixels needed to display the specified |
| 86 // string. | 89 // string. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 int height_; | 260 int height_; |
| 258 int ascent_; | 261 int ascent_; |
| 259 int avg_width_; | 262 int avg_width_; |
| 260 #endif | 263 #endif |
| 261 | 264 |
| 262 }; | 265 }; |
| 263 | 266 |
| 264 } // namespace gfx | 267 } // namespace gfx |
| 265 | 268 |
| 266 #endif // APP_GFX_FONT_H_ | 269 #endif // APP_GFX_FONT_H_ |
| OLD | NEW |