MCPcopy Create free account
hub / github.com/Snapchat/Valdi / toUTF8

Function toUTF8

snap_drawing/src/snap_drawing/cpp/Text/TextLayoutBuilder.cpp:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33using TextLineOffsetVector = Valdi::SmallVector<TextLineOffset, 2>;
34
35static std::string toUTF8(const ShapedGlyph* glyphsBegin, const ShapedGlyph* glyphsEnd) {
36 std::vector<Character> unicode;
37 unicode.resize(glyphsEnd - glyphsBegin);
38
39 auto* unicodePtr = unicode.data();
40
41 const auto* it = glyphsBegin;
42 while (it != glyphsEnd) {
43 *unicodePtr = it->character();
44 it++;
45 unicodePtr++;
46 }
47
48 return unicodeToUtf8(unicode.data(), unicode.size());
49}
50
51template<typename T>
52static void forEachSegmentsLine(TextLayoutBuilderSegment* begin, TextLayoutBuilderSegment* end, T&& cb) {

Callers 2

outputDebugFunction · 0.85
outputSegmentToEntryMethod · 0.85

Calls 5

unicodeToUtf8Function · 0.85
characterMethod · 0.80
resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected