OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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_DECORATED_TEXT_H_ | |
6 #define UI_GFX_DECORATED_TEXT_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/strings/string16.h" | |
11 #include "ui/gfx/font.h" | |
12 #include "ui/gfx/range/range.h" | |
13 | |
14 namespace gfx { | |
15 | |
16 // Encapsulates styling information for some given text. | |
17 struct DecoratedText { | |
18 // Describes the various text decoration attributes applicable to a given | |
19 // range of text. | |
20 struct RangedAttribute { | |
21 // Disallow default construction of Font, since that's slow. | |
22 RangedAttribute() = delete; | |
23 RangedAttribute(const Range& range, const Font& font); | |
24 | |
25 // The range in |text|, this RangedAttribute corresponds to. Should not be | |
26 // reversed and should lie within the bounds of |text|. | |
27 Range range; | |
28 Font font; | |
29 Font::Weight weight; | |
tapted
2016/09/26 02:02:31
can weight, underline, italic be retrieved from th
karandeepb
2016/09/26 07:00:08
I am retrieving these from TextRunHarfBuzz. Its fo
| |
30 bool underline; | |
31 bool italic; | |
32 bool strike; | |
33 bool diagonal_strike; | |
34 }; | |
35 | |
36 DecoratedText(); | |
37 ~DecoratedText(); | |
38 | |
39 base::string16 text; | |
40 | |
41 // Vector of RangedAttribute describing styling of non-overlapping ranges | |
42 // in |text|. | |
43 std::vector<RangedAttribute> attributes; | |
44 }; | |
45 | |
46 }; // namespace gfx | |
47 | |
48 #endif // UI_GFX_DECORATED_TEXT_H_ | |
OLD | NEW |