// Check if whether is right to left markup and Keeps true if the previous value was true.
currentScriptRun.isRightToLeft = currentScriptRun.isRightToLeft || TextAbstraction::IsRightToLeftMark(character);
- if(TextAbstraction::EMOJI == currentScriptRun.script)
+ // ZWJ, ZWNJ between emojis should be treated as EMOJI.
+ if(TextAbstraction::EMOJI == currentScriptRun.script && !(TextAbstraction::IsZeroWidthJoiner(character) || TextAbstraction::IsZeroWidthNonJoiner(character)))
{
// Emojis doesn't mix well with characters common to all scripts. Insert the emoji run.
scripts.Insert(scripts.Begin() + scriptIndex, currentScriptRun);
Vector<ScriptRun>::ConstIterator scriptRunEndIt = scripts.End();
bool isNewParagraphCharacter = false;
- bool isPreviousEmojiScript = false;
+ bool isPreviousEmojiScript = false;
+ FontId previousEmojiFontId = 0u;
CharacterIndex lastCharacter = startIndex + numberOfCharacters;
for(Length index = startIndex; index < lastCharacter; ++index)
currentFontRun.isBoldRequired = false;
}
+ // ZWJ, ZWNJ between emojis should use the previous emoji font.
+ if(isEmojiScript && (TextAbstraction::IsZeroWidthJoiner(character) || TextAbstraction::IsZeroWidthNonJoiner(character)))
+ {
+ if(0u != previousEmojiFontId)
+ {
+ fontId = previousEmojiFontId;
+ 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,
} // !isValidFont (2)
} // !isValidFont (1)
+ // Store the font id when the first character is an emoji.
+ if(isEmojiScript && !isPreviousEmojiScript)
+ {
+ if(0u != fontId)
+ {
+ previousEmojiFontId = fontId;
+ }
+ }
+
#ifdef DEBUG_ENABLED
{
Dali::TextAbstraction::FontDescription description;