if( TextAbstraction::UNKNOWN == script )
{
- script = TextAbstraction::LATIN;
- DALI_ASSERT_DEBUG( !"MultilanguageSupport::SetScripts. Unkown script!" );
+ if( IsZeroWidthNonJoiner( character ) ||
+ IsZeroWidthJoiner( character ) ||
+ IsZeroWidthSpace( character ) ||
+ IsLeftToRightMark( character ) ||
+ IsRightToLeftMark( character ) ||
+ IsThinSpace( character ) )
+ {
+ // Keep previous script if the character is a zero width joiner or a zero width non joiner.
+ script = currentScriptRun.script;
+ }
+ else
+ {
+ script = TextAbstraction::LATIN;
+ DALI_ASSERT_DEBUG( !"MultilanguageSupport::SetScripts. Unkown script!" );
+ }
}
if( script != currentScriptRun.script )
namespace Text
{
+namespace
+{
+const unsigned int CHAR_ZWS = 0x200B; ///< Zero width space.
+const unsigned int CHAR_ZWNJ = 0x200C; ///< Zero width non joiner.
+const unsigned int CHAR_ZWJ = 0x200D; ///< Zero width joiner.
+const unsigned int CHAR_LTRM = 0x200E; ///< Left to Right Mark.
+const unsigned int CHAR_RTLM = 0x200F; ///< Right to Left Mark.
+const unsigned int CHAR_TS = 0x2009; ///< Thin Space.
+} // namespace
+
Script GetCharacterScript( Character character )
{
// Latin script:
// 0x0e00 - 0x0e7f Thai
// Burmese script
- // 0x1000 - 0x104f Myanmar
+ // 0x1000 - 0x109f Myanmar
if( character <= 0x0cff )
{
return TextAbstraction::LAO;
}
- if( ( 0x1000 <= character ) && ( character <= 0x104f ) )
+ if( ( 0x1000 <= character ) && ( character <= 0x109f ) )
{
return TextAbstraction::BURMESE;
}
return TextAbstraction::UNKNOWN;
}
+bool IsZeroWidthNonJoiner( Character character )
+{
+ return CHAR_ZWNJ == character;
+}
+
+bool IsZeroWidthJoiner( Character character )
+{
+ return CHAR_ZWJ == character;
+}
+
+bool IsZeroWidthSpace( Character character )
+{
+ return CHAR_ZWS == character;
+}
+
+bool IsLeftToRightMark( Character character )
+{
+ return CHAR_LTRM == character;
+}
+
+bool IsRightToLeftMark( Character character )
+{
+ return CHAR_RTLM == character;
+}
+
+bool IsThinSpace( Character character )
+{
+ return CHAR_TS == character;
+}
+
} // namespace Text
} // namespace Toolkit
*/
Script GetCharacterScript( Character character );
+/**
+ * @brief Whether the character is a zero width non joiner.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a zero width non joiner.
+ */
+bool IsZeroWidthNonJoiner( Character character );
+
+/**
+ * @brief Whether the character is a zero width joiner.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a zero width joiner.
+ */
+bool IsZeroWidthJoiner( Character character );
+
+/**
+ * @brief Whether the character is a zero width space.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a zero width space.
+ */
+bool IsZeroWidthSpace( Character character );
+
+/**
+ * @brief Whether the character is a left to right mark.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a left to right mark.
+ */
+bool IsLeftToRightMark( Character character );
+
+/**
+ * @brief Whether the character is a right to left mark.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a right to left mark.
+ */
+bool IsRightToLeftMark( Character character );
+
+/**
+ * @brief Whether the character is a thin space.
+ *
+ * @param[in] character The character.
+ *
+ * @return @e true if the character is a thin space.
+ */
+bool IsThinSpace( Character character );
+
} // namespace Text
} // namespace Toolkit