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

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

Issue 22835002: Supports gfx::FontList in gfx::Canvas and ui::ElideText family. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Introduces layout_text.h to provide GetStringWidth(). Created 7 years, 4 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_LAYOUT_TEXT_H_
6 #define UI_GFX_LAYOUT_TEXT_H_
7
8 #include "base/basictypes.h"
9 #include "base/strings/string16.h"
10 #include "ui/base/ui_export.h"
11
12 namespace gfx {
13
14 class FontList;
15
16 // LayoutText represents an interface of layout engines and provides APIs to get
17 // text layout information.
18 class UI_EXPORT LayoutText {
Alexei Svitkine (slow) 2013/08/20 15:17:21 I don't think this needs its own class. Just make
Yuki 2013/08/20 16:45:42 If everyone is okay to define gfx::GetStringWidth(
Yuki 2013/08/21 03:42:44 Done.
19 public:
20 // Returns the number of horizontal pixels needed to display the specified
21 // |text| with |font_list|.
22 static int GetStringWidth(const base::string16& text,
23 const FontList& font_list);
24
25 private:
26 DISALLOW_COPY_AND_ASSIGN(LayoutText);
27 };
28
29 } // namespace gfx
30
31 #endif // UI_GFX_LAYOUT_TEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698