| 33 | using TextLineOffsetVector = Valdi::SmallVector<TextLineOffset, 2>; |
| 34 | |
| 35 | static 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 | |
| 51 | template<typename T> |
| 52 | static void forEachSegmentsLine(TextLayoutBuilderSegment* begin, TextLayoutBuilderSegment* end, T&& cb) { |
no test coverage detected