Add log for font load validation 31/277931/4
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 15 Jul 2022 06:32:38 +0000 (15:32 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 18 Jul 2022 06:00:04 +0000 (15:00 +0900)
Add log when isValidFont is false for easy debugging.
It is usually false if the platform couldn't find a suitable glyph.

Change-Id: Icdc1e929a7c11ee3033c877b35ba7048e44bbd17
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp

index 2ff4a7d..f7bf429 100644 (file)
@@ -1140,6 +1140,7 @@ int UtcDaliToolkitTextLabelEmojisP(void)
 
   // EMOJI Sequences case for coverage.
   std::string emojiSequences =
 
   // EMOJI Sequences case for coverage.
   std::string emojiSequences =
+    "Glyphs not included in the font &#xf01a;&#xf01b;&#xf01c;&#xf01d;&#xf01e;&#xf01f;\n"   //case for coverage when glyph is not included in the font
     "Text VS15 &#x262a;&#xfe0e;\n"                                                         //text presentation sequence and selector
     "Color VS16 &#x262a;&#xfe0f;\n"                                                        //emoji presentation sequence and selector
     "Default &#x262a; \n"                                                                  //default presentation
     "Text VS15 &#x262a;&#xfe0e;\n"                                                         //text presentation sequence and selector
     "Color VS16 &#x262a;&#xfe0f;\n"                                                        //emoji presentation sequence and selector
     "Default &#x262a; \n"                                                                  //default presentation
index 96210ca..f24d427 100644 (file)
@@ -542,7 +542,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
     }
 
     bool isCommonScript = false;
     }
 
     bool isCommonScript = false;
-    bool isEmojiScript  = TextAbstraction::IsEmojiScript(script) || TextAbstraction::IsEmojiColorScript(script) || TextAbstraction::IsEmojiTextScript(script);
+    bool isEmojiScript  = TextAbstraction::IsOneOfEmojiScripts(script);
 
     if(isEmojiScript && (previousScript == script))
     {
 
     if(isEmojiScript && (previousScript == script))
     {
@@ -628,6 +628,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
           {
             // Use the cached default font for the script if there is one.
             fontId = cachedDefaultFontId;
           {
             // Use the cached default font for the script if there is one.
             fontId = cachedDefaultFontId;
+            isValidFont = true;
           }
           else
           {
           }
           else
           {
@@ -660,6 +661,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
                 }
               }
               defaultFontsPerScript->Cache(currentFontDescription, fontId);
                 }
               }
               defaultFontsPerScript->Cache(currentFontDescription, fontId);
+              isValidFont = true;
             }
           }
         } // !isValidFont (3)
             }
           }
         } // !isValidFont (3)
@@ -729,6 +731,15 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
                     description.path.c_str());
     }
 #endif
                     description.path.c_str());
     }
 #endif
+    if(!isValidFont && !isCommonScript)
+    {
+      Dali::TextAbstraction::FontDescription descriptionForLog;
+      fontClient.GetDescription(fontId, descriptionForLog);
+      DALI_LOG_RELEASE_INFO("Validated font set fail : Character : %x, Script : %s, Font : %s \n",
+                            character,
+                            Dali::TextAbstraction::ScriptName[script],
+                            descriptionForLog.path.c_str());
+    }
 
     // Whether bols style is required.
     isBoldRequired = (currentFontDescription.weight >= TextAbstraction::FontWeight::BOLD);
 
     // Whether bols style is required.
     isBoldRequired = (currentFontDescription.weight >= TextAbstraction::FontWeight::BOLD);