COMMON script added. 28/41128/1
authorVictor Cebollada <v.cebollada@samsung.com>
Thu, 11 Jun 2015 08:19:33 +0000 (09:19 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Thu, 11 Jun 2015 08:20:26 +0000 (09:20 +0100)
Change-Id: Ic809fdb911b4fcab2e8eec2beeb05732be603a18
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
text/dali/devel-api/text-abstraction/script.cpp
text/dali/devel-api/text-abstraction/script.h
text/dali/internal/text-abstraction/shaping-impl.cpp

index fe817d6..1e192f3 100644 (file)
@@ -167,6 +167,11 @@ Script GetCharacterScript( Character character )
   // 6b. Additional transport and map symbols ( 1F681 - 1F6C5 )
   // 6c. Other additional symbols ( 1F30D - 1F567 )
 
+  if( IsCommonScript( character ) )
+  {
+    return COMMON;
+  }
+
   if( character <= 0x0cff )
   {
     if( character <= 0x09ff )
@@ -566,6 +571,18 @@ bool IsThinSpace( Character character )
   return CHAR_TS == character;
 }
 
+bool IsCommonScript( Character character )
+{
+  return ( IsWhiteSpace( character )         ||
+           IsZeroWidthNonJoiner( character ) ||
+           IsZeroWidthJoiner( character )    ||
+           IsZeroWidthSpace( character )     ||
+           IsLeftToRightMark( character )    ||
+           IsRightToLeftMark( character )    ||
+           IsThinSpace( character )          ||
+           IsNewParagraph( character ) );
+}
+
 } // namespace TextAbstraction
 
 } // namespace Dali
index 9341f98..06b1301 100644 (file)
@@ -36,6 +36,8 @@ namespace TextAbstraction
  */
 enum Script
 {
+  COMMON,     ///< Valid for all scripts. i.e white space or '\n'.
+
   CYRILLIC,   ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
   GREEK,      ///< The Greek script. Used by Greek.
   LATIN,      ///< The latin script. Used by many western languages and others around the world.
@@ -74,6 +76,8 @@ enum Script
 
 const char* const ScriptName[] =
 {
+  "COMMON",     ///< Valid for all scripts. i.e white space or '\n'.
+
   "CYRILLIC",   ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
   "GREEK",      ///< The Greek script. Used by Greek.
   "LATIN",      ///< The latin script. Used by many western languages and others around the world.
@@ -200,6 +204,15 @@ DALI_IMPORT_API bool IsRightToLeftMark( Character character );
  */
 DALI_IMPORT_API bool IsThinSpace( Character character );
 
+/**
+ * @brief Whether the character is common within all scripts.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is common within all scripts.
+ */
+DALI_IMPORT_API bool IsCommonScript( Character character );
+
 } // namespace TextAbstraction
 
 } // namespace Dali
index fd6e8dc..5e33fa5 100644 (file)
@@ -45,6 +45,8 @@ const float        FROM_266 = 1.0f / 64.0f;
 
 const hb_script_t SCRIPT_TO_HARFBUZZ[] =
 {
+  HB_SCRIPT_COMMON,
+
   HB_SCRIPT_CYRILLIC,
   HB_SCRIPT_GREEK,
   HB_SCRIPT_LATIN,