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

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

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix round-down problems Created 7 years, 2 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
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_FONT_LIST_H_ 5 #ifndef UI_GFX_FONT_LIST_H_
6 #define UI_GFX_FONT_LIST_H_ 6 #define UI_GFX_FONT_LIST_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 int GetHeight() const; 78 int GetHeight() const;
79 79
80 // Returns the baseline of this font list, which is max(baseline) for all the 80 // Returns the baseline of this font list, which is max(baseline) for all the
81 // fonts in the font list. 81 // fonts in the font list.
82 int GetBaseline() const; 82 int GetBaseline() const;
83 83
84 // Returns the cap height of this font list. 84 // Returns the cap height of this font list.
85 // Currently returns the cap height of the primary font. 85 // Currently returns the cap height of the primary font.
86 int GetCapHeight() const; 86 int GetCapHeight() const;
87 87
88 // Returns the number of horizontal pixels needed to display |text|. 88 // Returns the pixel width needed to display |text|.
89 int GetStringWidth(const base::string16& text) const; 89 float GetStringWidth(const base::string16& text) const;
90 90
91 // Returns the expected number of horizontal pixels needed to display the 91 // Returns the expected pixel width needed to display the specified length of
92 // specified length of characters. Call GetStringWidth() to retrieve the 92 // characters. Call GetStringWidth() to retrieve the actual number.
93 // actual number. 93 float GetExpectedTextWidth(int length) const;
94 int GetExpectedTextWidth(int length) const;
95 94
96 // Returns the |gfx::Font::FontStyle| style flags for this font list. 95 // Returns the |gfx::Font::FontStyle| style flags for this font list.
97 int GetFontStyle() const; 96 int GetFontStyle() const;
98 97
99 // Returns a string representing font names, styles, and size. If the FontList 98 // Returns a string representing font names, styles, and size. If the FontList
100 // is initialized by a vector of Font, use the first font's style and size 99 // is initialized by a vector of Font, use the first font's style and size
101 // for the description. 100 // for the description.
102 const std::string& GetFontDescriptionString() const; 101 const std::string& GetFontDescriptionString() const;
103 102
104 // Returns the font size in pixels. 103 // Returns the font size in pixels.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 mutable int common_baseline_; 135 mutable int common_baseline_;
137 136
138 // Cached font style and size. 137 // Cached font style and size.
139 mutable int font_style_; 138 mutable int font_style_;
140 mutable int font_size_; 139 mutable int font_size_;
141 }; 140 };
142 141
143 } // namespace gfx 142 } // namespace gfx
144 143
145 #endif // UI_GFX_FONT_LIST_H_ 144 #endif // UI_GFX_FONT_LIST_H_
OLDNEW
« ui/gfx/canvas.h ('K') | « ui/gfx/font.cc ('k') | ui/gfx/font_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698