| 117 | } |
| 118 | |
| 119 | static 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 | |
| 140 | std::pair<std::vector<GlyphHandle>, std::vector<GlyphHandle>> GetGlyphs( |
| 141 | const std::vector<std::vector<GlyphHandle>>& glyphLines) { |
no test coverage detected