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

Side by Side Diff: ui/gfx/font.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 trybots 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_H_ 5 #ifndef UI_GFX_FONT_H_
6 #define UI_GFX_FONT_H_ 6 #define UI_GFX_FONT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // Returns the cap height of the font. 72 // Returns the cap height of the font.
73 int GetCapHeight() const; 73 int GetCapHeight() const;
74 74
75 // Returns the average character width for the font. 75 // Returns the average character width for the font.
76 int GetAverageCharacterWidth() const; 76 int GetAverageCharacterWidth() const;
77 77
78 // Returns the number of horizontal pixels needed to display the specified 78 // Returns the number of horizontal pixels needed to display the specified
79 // string. 79 // string.
80 int GetStringWidth(const base::string16& text) const; 80 int GetStringWidth(const base::string16& text) const;
81 81
82 // Returns the pixel width needed to display the specified string. Note that
83 // the fractional width might be returned in some platforms.
84 float GetStringWidthF(const base::string16& text) const;
Alexei Svitkine (slow) 2013/10/07 21:43:39 Is this actually needed? Does someone need to use
jianli 2013/10/07 23:18:45 Done.
85
82 // Returns the expected number of horizontal pixels needed to display the 86 // Returns the expected number of horizontal pixels needed to display the
83 // specified length of characters. Call GetStringWidth() to retrieve the 87 // specified length of characters. Call GetStringWidth() to retrieve the
84 // actual number. 88 // actual number.
85 int GetExpectedTextWidth(int length) const; 89 int GetExpectedTextWidth(int length) const;
86 90
87 // Returns the style of the font. 91 // Returns the style of the font.
88 int GetStyle() const; 92 int GetStyle() const;
89 93
90 // Returns the font name in UTF-8. 94 // Returns the font name in UTF-8.
91 std::string GetFontName() const; 95 std::string GetFontName() const;
(...skipping 16 matching lines...) Expand all
108 PlatformFont* platform_font() const { return platform_font_.get(); } 112 PlatformFont* platform_font() const { return platform_font_.get(); }
109 113
110 private: 114 private:
111 // Wrapped platform font implementation. 115 // Wrapped platform font implementation.
112 scoped_refptr<PlatformFont> platform_font_; 116 scoped_refptr<PlatformFont> platform_font_;
113 }; 117 };
114 118
115 } // namespace gfx 119 } // namespace gfx
116 120
117 #endif // UI_GFX_FONT_H_ 121 #endif // UI_GFX_FONT_H_
OLDNEW
« no previous file with comments | « ui/gfx/canvas_unittest_mac.mm ('k') | ui/gfx/font.cc » ('j') | ui/gfx/font_list.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698