Index: ui/gfx/layout_text.h |
diff --git a/ui/gfx/layout_text.h b/ui/gfx/layout_text.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..70957fb4123c5df3577b281c549774b2bdf894ee |
--- /dev/null |
+++ b/ui/gfx/layout_text.h |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_GFX_LAYOUT_TEXT_H_ |
+#define UI_GFX_LAYOUT_TEXT_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/strings/string16.h" |
+#include "ui/base/ui_export.h" |
+ |
+namespace gfx { |
+ |
+class FontList; |
+ |
+// LayoutText represents an interface of layout engines and provides APIs to get |
+// text layout information. |
+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.
|
+ public: |
+ // Returns the number of horizontal pixels needed to display the specified |
+ // |text| with |font_list|. |
+ static int GetStringWidth(const base::string16& text, |
+ const FontList& font_list); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(LayoutText); |
+}; |
+ |
+} // namespace gfx |
+ |
+#endif // UI_GFX_LAYOUT_TEXT_H_ |