Fix colon case 82/315482/2
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 2 Dec 2024 08:21:30 +0000 (17:21 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 2 Dec 2024 09:31:36 +0000 (18:31 +0900)
If the current script run is ASCII_DIGITS, include the colon in the same script run.
Including both ASCII_DIGITS and ASCII_PS in the same script run can reduce unnecessary script run generation.
But I am still not sure about this.

Change-Id: Id74bf898d93df6481cf759a439b4a48c65b8198a
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/text/multi-language-support-impl.cpp

index 8abc3afd7502dc20e87b493e37fd45cdeba3c875..b16e6d5dcbb54c8d01aef2b011b72dd129021b80 100644 (file)
@@ -40,7 +40,8 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_MULT
 
 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_FONT_PERFORMANCE_MARKER, false);
 
-const Dali::Toolkit::Text::Character UTF32_A = 0x0041;
+const Dali::Toolkit::Text::Character UTF32_A     = 0x0041;
+const Dali::Toolkit::Text::Character UTF32_COLON = 0x3A;
 } // namespace
 
 namespace Text
@@ -506,8 +507,13 @@ void MultilanguageSupport::SetScripts(const Vector<Character>& text,
       isFirstScriptToBeSet = false;
     }
 
+    // If the current script run is ASCII_DIGITS and character is colon, include the colon in the same script run.
+    // TODO : Use the same script for all ASCII_DIGITS and ASCII_PS.
+    bool isColonCase = (character == UTF32_COLON) && (TextAbstraction::ASCII_DIGITS == currentScriptRun.script) && (TextAbstraction::COMMON != script);
+
     if((script != currentScriptRun.script) &&
-       (TextAbstraction::COMMON != script))
+       (TextAbstraction::COMMON != script) &&
+       !isColonCase)
     {
       // Current run needs to be stored and a new one initialized.