- const CharacterIndex selectionEndMinusOne = selectionEnd - 1u;
- const GlyphIndex glyphStart = *(charactersToGlyphBuffer + selectionStart);
- const Length numberOfGlyphs = *(glyphsPerCharacterBuffer + selectionEndMinusOne);
- const GlyphIndex glyphEnd = *(charactersToGlyphBuffer + selectionEndMinusOne) + ((numberOfGlyphs > 0) ? numberOfGlyphs - 1u : 0u);
+ const CharacterIndex selectionEndMinusOne = selectionEnd - 1u;
+ const GlyphIndex glyphStart = *(charactersToGlyphBuffer + selectionStart);
+ const Length numberOfGlyphs = *(glyphsPerCharacterBuffer + selectionEndMinusOne);
+ const GlyphIndex glyphEnd = *(charactersToGlyphBuffer + selectionEndMinusOne) + ((numberOfGlyphs > 0) ? numberOfGlyphs - 1u : 0u);
+ const float modelCharacterSpacing = visualModel->GetCharacterSpacing();
+ Vector<CharacterIndex>& glyphToCharacterMap = visualModel->mGlyphsToCharacters;
+ const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin();
+
+ // Get the character-spacing runs.
+ const Vector<CharacterSpacingGlyphRun>& characterSpacingGlyphRuns = visualModel->GetCharacterSpacingGlyphRuns();