| 153 | } |
| 154 | |
| 155 | static std::pair<float, float> FindMinMaxPathPosition( |
| 156 | const TextPathLayout& pathLayout, const std::vector<std::vector<GlyphHandle>>& glyphLines) { |
| 157 | float first = 0; |
| 158 | float end = pathLayout.pathLength; |
| 159 | |
| 160 | for (const auto& line : glyphLines) { |
| 161 | for (const auto& glyph : line) { |
| 162 | auto advance = glyph->getAdvance(); |
| 163 | auto posX = glyph->getMatrix().getTranslateX(); |
| 164 | first = std::min(first, MapToPathPosition(posX, pathLayout)); |
| 165 | end = std::max(end, MapToPathPosition(posX + advance, pathLayout)); |
| 166 | } |
| 167 | } |
| 168 | return {first, end}; |
| 169 | } |
| 170 | |
| 171 | static float CalculateForceAlignmentLetterSpacing(const TextPathLayout& layout, |
| 172 | const std::vector<GlyphHandle>& line) { |
no test coverage detected