Revert "[Tizen] Fix ZWJ, ZWNJ issues"
authortscholb <scholb.kim@samsung.com>
Mon, 1 Nov 2021 08:48:53 +0000 (17:48 +0900)
committertscholb <scholb.kim@samsung.com>
Mon, 1 Nov 2021 08:48:57 +0000 (17:48 +0900)
This reverts commit a995feabfdceed564876ae754c14d571b02285c7.

Change-Id: I63aeaf1e495be649b6e49771eddfb63bf4ae80a9

automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp

index c9453e1..5495c9d 100644 (file)
@@ -836,13 +836,6 @@ int UtcDaliToolkitTextLabelEmojisP(void)
   application.SendNotification();
   application.Render();
 
-  // EMOJI + ZWJ + EMOJI case for coverage.
-  const std::string emojiWithZWJ = "&#x1f469;&#x200d;&#x1f52c;";
-  label.SetProperty( TextLabel::Property::TEXT, emojiWithZWJ );
-
-  application.SendNotification();
-  application.Render();
-
   END_TEST;
 }
 
index 82470f8..a0e6ae5 100644 (file)
@@ -228,8 +228,7 @@ void MultilanguageSupport::SetScripts(const Vector<Character>& text,
       // Check if whether is right to left markup and Keeps true if the previous value was true.
       currentScriptRun.isRightToLeft = currentScriptRun.isRightToLeft || TextAbstraction::IsRightToLeftMark(character);
 
-      // ZWJ, ZWNJ between emojis should be treated as EMOJI.
-      if(TextAbstraction::EMOJI == currentScriptRun.script && !(TextAbstraction::IsZeroWidthJoiner(character) || TextAbstraction::IsZeroWidthNonJoiner(character)))
+      if(TextAbstraction::EMOJI == currentScriptRun.script)
       {
         // Emojis doesn't mix well with characters common to all scripts. Insert the emoji run.
         scripts.Insert(scripts.Begin() + scriptIndex, currentScriptRun);
@@ -445,8 +444,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
   Vector<ScriptRun>::ConstIterator scriptRunEndIt          = scripts.End();
   bool                             isNewParagraphCharacter = false;
 
-  bool   isPreviousEmojiScript = false;
-  FontId previousEmojiFontId   = 0u;
+  bool isPreviousEmojiScript = false;
 
   CharacterIndex lastCharacter = startIndex + numberOfCharacters;
   for(Length index = startIndex; index < lastCharacter; ++index)
@@ -537,16 +535,6 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
       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,
@@ -659,15 +647,6 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
       }   // !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;