[Tizen] Fix colon case 99/315899/1 accepted/tizen/7.0/unified/20241206.165036
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 2 Dec 2024 08:21:30 +0000 (17:21 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 6 Dec 2024 02:35:27 +0000 (11:35 +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 0b6ea1d1018bc335fe7658df010d6ba7ebc17081..2ad3a8591f22e273cd6100ba74b964a51df7e06a 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
@@ -333,8 +334,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.