MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / stripSoftHyphensInPlace

Function stripSoftHyphensInPlace

lib/Epub/Epub/ParsedText.cpp:190–195  ·  view source on GitHub ↗

Removes every soft hyphen in-place so rendered glyphs match measured widths.

Source from the content-addressed store, hash-verified

188
189// Removes every soft hyphen in-place so rendered glyphs match measured widths.
190void 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

Callers 2

measureWordWidthFunction · 0.85
extractLineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected