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

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

Issue 1070223004: Stop combining text runs which are connected by 'COMMON' blocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address msw@'s comments. Created 5 years, 6 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_TEXT_UTILS_H_ 5 #ifndef UI_GFX_TEXT_UTILS_H_
6 #define UI_GFX_TEXT_UTILS_H_ 6 #define UI_GFX_TEXT_UTILS_H_
7 7
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "ui/gfx/gfx_export.h" 9 #include "ui/gfx/gfx_export.h"
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 // Returns the number of horizontal pixels needed to display the specified 25 // Returns the number of horizontal pixels needed to display the specified
26 // |text| with |font_list|. 26 // |text| with |font_list|.
27 GFX_EXPORT int GetStringWidth(const base::string16& text, 27 GFX_EXPORT int GetStringWidth(const base::string16& text,
28 const FontList& font_list); 28 const FontList& font_list);
29 29
30 // This is same as GetStringWidth except that fractional width is returned. 30 // This is same as GetStringWidth except that fractional width is returned.
31 GFX_EXPORT float GetStringWidthF(const base::string16& text, 31 GFX_EXPORT float GetStringWidthF(const base::string16& text,
32 const FontList& font_list); 32 const FontList& font_list);
33 33
34 // Returns a valid cut boundary at or before |index|. The surrogate pair and
35 // combined characters should not be separated.
36 GFX_EXPORT size_t
37 FindValidBoundaryBefore(const base::string16& text, size_t index);
msw 2015/06/03 00:32:04 nit: Is this the correct line breaking according t
xdai1 2015/06/06 00:05:19 Yes, this is the correct line breaking. It's gener
38
39 // Returns a valid cut boundary at or after |index|. The surrogate pair and
40 // combined characters should not be separated.
41 GFX_EXPORT size_t
42 FindValidBoundaryAfter(const base::string16& text, size_t index);
43
34 } // namespace gfx 44 } // namespace gfx
35 45
36 #endif // UI_GFX_TEXT_UTILS_H_ 46 #endif // UI_GFX_TEXT_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698