namespace Dali
{
+const Rect<int> TestApplication::DEFAULT_SURFACE_RECT = Rect<int>(0, 0, TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT);
+
bool TestApplication::mLoggingEnabled = true;
TestApplication::TestApplication(uint32_t surfaceWidth,
bool TestApplication::RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
{
- mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/, clippingRect);
+ mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect);
mCore->PostRender(false /*do not skip rendering*/);
// 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;