MCPcopy Create free account
hub / github.com/comaps/comaps / GetTextSegments

Function GetTextSegments

libs/drape/harfbuzz_shaping.cpp:214–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212} // namespace
213
214TextSegments GetTextSegments(std::string_view utf8)
215{
216 ASSERT(!utf8.empty(), ("Shaping of empty strings is not supported"));
217 ASSERT(std::string::npos == utf8.find_first_of("\n"), ("Shaping with line breaks is not supported", utf8));
218
219 // TODO(AB): Can unnecessary conversion/allocation be avoided?
220 TextSegments segments{strings::ToUtf16(utf8), {}};
221 // TODO(AB): Runs are not split by breaking chars and by different fonts.
222 GetSingleTextLineRuns(segments);
223 ReorderRTL(segments);
224 return segments;
225}
226
227std::string DebugPrint(TextSegment const & segment)
228{

Callers 4

ShapeTextMethod · 0.85
ItemizeLineFunction · 0.85
UNIT_TESTFunction · 0.85
RenderGlyphsMethod · 0.85

Calls 5

ASSERTFunction · 0.85
ToUtf16Function · 0.85
GetSingleTextLineRunsFunction · 0.85
ReorderRTLFunction · 0.85
emptyMethod · 0.45

Tested by 2

UNIT_TESTFunction · 0.68
RenderGlyphsMethod · 0.68