Go to the source code of this file.
◆ is_breaking_whitespace()
static bool is_breaking_whitespace |
( |
SkUnichar |
c | ) |
|
|
inlinestatic |
Definition at line 54 of file SkShaper_primitive.cpp.
54 {
55 switch (c) {
56 case 0x0020:
57
58 case 0x1680:
59 case 0x180E:
60 case 0x2000:
61 case 0x2001:
62 case 0x2002:
63 case 0x2003:
64 case 0x2004:
65 case 0x2005:
66 case 0x2006:
67 case 0x2007:
68 case 0x2008:
69 case 0x2009:
70 case 0x200A:
71 case 0x200B:
72 case 0x202F:
73 case 0x205F:
74 case 0x3000:
75
76 return true;
77 default:
78 return false;
79 }
80}
◆ linebreak()
static size_t linebreak |
( |
const char |
text[], |
|
|
const char |
stop[], |
|
|
const SkFont & |
font, |
|
|
SkScalar |
width, |
|
|
SkScalar * |
advance, |
|
|
size_t * |
trailing |
|
) |
| |
|
static |
Definition at line 82 of file SkShaper_primitive.cpp.
86{
88 int glyphIndex = 0;
90 const char* wordStart =
text;
91 bool prevWS = true;
92 *trailing = 0;
93
95 const char* prevText =
text;
97 accumulatedWidth += advance[glyphIndex++];
99
100 if (!currWS && prevWS) {
101 wordStart = prevText;
102 }
103 prevWS = currWS;
104
105 if (
width < accumulatedWidth) {
106 bool consumeWhitespace = false;
107 if (currWS) {
108
109 if (prevText ==
start) {
110
112 }
113 consumeWhitespace = true;
114 }
else if (wordStart !=
start) {
115
117 }
else if (prevText >
start) {
118
120 } else {
121
123 consumeWhitespace = true;
124 }
125 if (consumeWhitespace) {
129 }
130 if (trailing) {
131 *trailing =
text - prevText;
132 }
133 }
134 break;
135 }
136 }
137
139}
static float next(float f)
static bool is_breaking_whitespace(SkUnichar c)
SK_SPI SkUnichar NextUTF8(const char **ptr, const char *end)