Merge "Generate Camera from loaded model" into devel/master
authorEunki Hong <eunkiki.hong@samsung.com>
Fri, 24 Feb 2023 06:30:30 +0000 (06:30 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 24 Feb 2023 06:30:30 +0000 (06:30 +0000)
dali-toolkit/internal/text/multi-language-support-impl.cpp

index f24d427..2ba2793 100644 (file)
@@ -468,8 +468,10 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
   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)
@@ -493,6 +495,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
 
     // 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,
@@ -554,6 +557,15 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
       }
     }
 
+    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,
@@ -776,6 +788,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
     // 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)