MCPcopy Create free account
hub / github.com/Tencent/libpag / CopyLines

Function CopyLines

src/rendering/caches/TextContentCache.cpp:119–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119static std::vector<std::vector<GlyphHandle>> CopyLines(
120 const std::shared_ptr<TextBlock>& textBlock) {
121 std::vector<std::vector<GlyphHandle>> glyphLines;
122 for (const auto& line : textBlock->lines()) {
123 std::vector<GlyphHandle> glyphLine;
124 glyphLine.reserve(line.size());
125 for (const auto& glyph : line) {
126 auto finalGlyph = std::make_shared<Glyph>(*glyph);
127 if (glyph->getStyle() != TextStyle::Fill && glyph->getStrokeWidth() < 0.1f) {
128 if (glyph->getStyle() == TextStyle::Stroke) {
129 continue;
130 }
131 finalGlyph->setStyle(TextStyle::Fill);
132 }
133 glyphLine.emplace_back(std::move(finalGlyph));
134 }
135 glyphLines.emplace_back(glyphLine);
136 }
137 return glyphLines;
138}
139
140std::pair<std::vector<GlyphHandle>, std::vector<GlyphHandle>> GetGlyphs(
141 const std::vector<std::vector<GlyphHandle>>& glyphLines) {

Callers 1

createContentMethod · 0.85

Calls 5

linesMethod · 0.80
sizeMethod · 0.80
getStyleMethod · 0.80
getStrokeWidthMethod · 0.80
setStyleMethod · 0.80

Tested by

no test coverage detected