Vector<ScriptRun>::ConstIterator scriptRunEndIt = scripts.End();
bool isNewParagraphCharacter = false;
- FontId previousEmojiFontId = 0u;
- TextAbstraction::Script previousScript = TextAbstraction::UNKNOWN;
+ FontId previousEmojiFontId = 0u;
+ FontId currentFontId = 0u;
+ FontId previousFontId = 0u;
+ TextAbstraction::Script previousScript = TextAbstraction::UNKNOWN;
CharacterIndex lastCharacter = startIndex + numberOfCharacters - 1u;
for(Length index = startIndex; index <= lastCharacter; ++index)
// Get the font for the current character.
FontId fontId = fontClient.GetFontId(currentFontDescription, currentFontPointSize);
+ currentFontId = fontId;
// Get the script for the current character.
Script script = GetScript(index,
}
}
+ if(TextAbstraction::IsSpace(character) &&
+ TextAbstraction::HasLigatureMustBreak(script) &&
+ isValidCachedDefaultFont &&
+ (isDefaultFont || (currentFontId == previousFontId)))
+ {
+ fontId = cachedDefaultFontId;
+ isValidFont = true;
+ }
+
// If the given font is not valid, it means either:
// - there is no cached font for the current script yet or,
// - the user has set a different font than the default one for the current script or,
// Whether the current character is a new paragraph character.
isNewParagraphCharacter = TextAbstraction::IsNewParagraph(character);
previousScript = script;
+ previousFontId = currentFontId;
} // end traverse characters.
if(0u != currentFontRun.characterRun.numberOfCharacters)