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

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

Issue 2839873003: PlatformFontMac: better guess for average width (Closed)
Patch Set: as -> attr_string Created 3 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
« no previous file with comments | « no previous file | ui/gfx/platform_font_mac.mm » ('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_MAC_H_ 5 #ifndef UI_GFX_PLATFORM_FONT_MAC_H_
6 #define UI_GFX_PLATFORM_FONT_MAC_H_ 6 #define UI_GFX_PLATFORM_FONT_MAC_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // constructors. 63 // constructors.
64 const std::string font_name_; // Corresponds to -[NSFont fontFamily]. 64 const std::string font_name_; // Corresponds to -[NSFont fontFamily].
65 const int font_size_; 65 const int font_size_;
66 const int font_style_; 66 const int font_style_;
67 const Font::Weight font_weight_; 67 const Font::Weight font_weight_;
68 68
69 // Cached metrics, generated in CalculateMetrics(). 69 // Cached metrics, generated in CalculateMetrics().
70 int height_; 70 int height_;
71 int ascent_; 71 int ascent_;
72 int cap_height_; 72 int cap_height_;
73 int average_width_; 73
74 // Cached average width, generated in GetExpectedTextWidth().
75 float average_width_ = 0.0;
74 76
75 // Details about how the font should be rendered. 77 // Details about how the font should be rendered.
76 FontRenderParams render_params_; 78 FontRenderParams render_params_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(PlatformFontMac); 80 DISALLOW_COPY_AND_ASSIGN(PlatformFontMac);
79 }; 81 };
80 82
81 } // namespace gfx 83 } // namespace gfx
82 84
83 #endif // UI_GFX_PLATFORM_FONT_MAC_H_ 85 #endif // UI_GFX_PLATFORM_FONT_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/platform_font_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698