// Default initialization does not keycap sequence
bool isNewKeycapSequence = false;
- if(currentCharacterIndex < lastCharacterIndex)
+ if(currentCharacterIndex <= lastCharacterIndex)
{
Character currentCharacter = *(textBuffer + currentCharacterIndex);
if(IsStartForKeycapSequence(currentCharacter))
// Default initialization does not VariationSelector sequence
bool isNewVariationSelectorSequence = false;
- if(currentCharacterIndex < lastCharacterIndex)
+ if(currentCharacterIndex <= lastCharacterIndex)
{
Character currentCharacter = *(textBuffer + currentCharacterIndex);
if(TextAbstraction::IsEmojiVariationSequences(currentCharacter))
currentScriptRun.isRightToLeft = false;
// Traverse all characters and set the scripts.
- const Length lastCharacter = startIndex + numberOfCharacters;
+ const Length lastCharacter = startIndex + numberOfCharacters - 1u;
- for(Length index = startIndex; index < lastCharacter; ++index)
+ for(Length index = startIndex; index <= lastCharacter; ++index)
{
Character character = *(textBuffer + index);
// script of the first character of the paragraph with a defined script.
// Skip those characters valid for many scripts like white spaces or '\n'.
- bool endOfText = index == lastCharacter;
+ bool endOfText = index > lastCharacter;
//Handle all Emoji Sequence cases
if(IsNewSequence(textBuffer, currentScriptRun.script, index, lastCharacter, script))
// Get the next character.
++index;
- endOfText = index == lastCharacter;
+ endOfText = index > lastCharacter;
if(!endOfText)
{
character = *(textBuffer + index);
FontId previousEmojiFontId = 0u;
TextAbstraction::Script previousScript = TextAbstraction::UNKNOWN;
- CharacterIndex lastCharacter = startIndex + numberOfCharacters;
- for(Length index = startIndex; index < lastCharacter; ++index)
+ CharacterIndex lastCharacter = startIndex + numberOfCharacters - 1u;
+ for(Length index = startIndex; index <= lastCharacter; ++index)
{
// Get the current character.
const Character character = *(textBuffer + index);