[Tizen] Add Combining Diacritical Marks to text script 83/319383/1 accepted/tizen/9.0/unified/20250212.171241
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 7 Feb 2025 06:24:59 +0000 (15:24 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 10 Feb 2025 08:07:45 +0000 (17:07 +0900)
Combining Diacritical Marks is an inherited script.
This is not used alone; it basically follows the previous script.
On the dali side, this is handled as a COMMON script.

Change-Id: Ib373ada7e46caccf025660e9bbc3aa2acc4e12f5
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali/devel-api/text-abstraction/script.cpp
dali/devel-api/text-abstraction/script.h

index 1a7c7a3a871a5267f305b6391b8c61d3a5edf927..adb9577086cd4ee0946cc1b126b07af3b9388d79 100644 (file)
@@ -239,6 +239,16 @@ constexpr unsigned int CHAR_BOM  = 0xFEFF; ///< Byte Order Mark.
 // 0xabc0 - 0xabff Meetei Mayek
 // 0xaae0 - 0xaaff Meetei Mayek Extensions
 
+// Inherited Script
+// Combining_Diacritical_Marks : https://en.wikipedia.org/wiki/Combining_Diacritical_Marks
+// 0x0300 - 0x036f
+// Many diacritics and non-spacing combining characters may be applied to characters from more than one script.
+// In these cases Unicode assigns them to the "inherited" script (ISO 15924 code Zinh),
+// which means that they have the same script class as the base character with which they combine,
+// and so in different contexts they may be treated as belonging to different scripts.
+// For example, U+0308  ̈  COMBINING DIAERESIS may combine either with U+0065 e LATIN SMALL LETTER E to create a Latin ë or with U+0435 е CYRILLIC SMALL LETTER IE for the Cyrillic ё.
+// In the former case, it inherits the Latin script of the base character, whereas in the latter case, it inherits the Cyrillic script of the base character.
+
 // The Emoji which map to standardized Unicode characters
 // 1. Emoticons ( 1F601 - 1F64F )
 // 2. Dingbats ( 2700 - 27BF )
@@ -1055,8 +1065,9 @@ bool IsCommonScript(Character character)
           IsLeftToRightMark(character) ||
           IsRightToLeftMark(character) ||
           IsThinSpace(character) ||
-          IsNewParagraph(character)) ||
-          IsByteOrderMark(character);
+          IsNewParagraph(character) ||
+          IsByteOrderMark(character) ||
+          IsCombiningDiacriticalMarks(character));
 }
 
 bool HasLigatureMustBreak(Script script)
@@ -1070,6 +1081,11 @@ Length GetNumberOfScripts()
   return SYMBOLS_NSLCL + 1;
 }
 
+bool IsCombiningDiacriticalMarks(Character character)
+{
+  return character >= 0x0300 && character <= 0x036f;
+}
+
 } // namespace TextAbstraction
 
 } // namespace Dali
index f79d8ec9c0f6f28311294344e6dd47940c0f8c80..d66258afc528e5e95ec66f37c98787f4e8f667a6 100644 (file)
@@ -313,6 +313,15 @@ DALI_ADAPTOR_API bool HasLigatureMustBreak(Script script);
  */
 DALI_ADAPTOR_API Length GetNumberOfScripts();
 
+/**
+ * @brief Whether the character is a combining diacritical marks.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a combining diacritical marks.
+ */
+DALI_ADAPTOR_API bool IsCombiningDiacriticalMarks(Character character);
+
 } // namespace TextAbstraction
 
 } // namespace Dali