Removes every soft hyphen in-place so rendered glyphs match measured widths.
| 188 | |
| 189 | // Removes every soft hyphen in-place so rendered glyphs match measured widths. |
| 190 | void stripSoftHyphensInPlace(std::string& word) { |
| 191 | size_t pos = 0; |
| 192 | while ((pos = word.find(SOFT_HYPHEN_UTF8, pos)) != std::string::npos) { |
| 193 | word.erase(pos, SOFT_HYPHEN_BYTES); |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | // Returns the advance width for a word while ignoring soft hyphen glyphs and optionally appending a visible hyphen. |
| 198 | // Uses advance width (sum of glyph advances + kerning) rather than bounding box width so that italic glyph overhangs |
no outgoing calls
no test coverage detected