From f81bbd583cdf3e83c3380a1d9464998462b84e91 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Thu, 12 Mar 2015 16:38:17 +0000 Subject: [PATCH] Scripts added: - Hebrew - Hiragana and Katakana (Japanese) Change-Id: Ibc5ddee96e605b5ca8774c2caea77c71852a9882 Signed-off-by: Victor Cebollada --- text/dali/public-api/text-abstraction/script.cpp | 45 +++++++++++++++++++----- text/dali/public-api/text-abstraction/script.h | 6 ++++ 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/text/dali/public-api/text-abstraction/script.cpp b/text/dali/public-api/text-abstraction/script.cpp index 6fea9a6..59d7a7c 100644 --- a/text/dali/public-api/text-abstraction/script.cpp +++ b/text/dali/public-api/text-abstraction/script.cpp @@ -44,8 +44,8 @@ const unsigned int CHAR_TS = 0x2009; ///< Thin Space. bool IsRightToLeftScript( Script script ) { - // VCC TODO: add hebrew and other right to left scripts if any. - return ARABIC == script; + return ( ( ARABIC == script ) || + ( HEBREW == script ) ); } Script GetCharacterScript( Character character ) @@ -66,7 +66,7 @@ Script GetCharacterScript( Character character ) // 0x2c60 - 0x2c7f Latin Extended-C // 0xa720 - 0xa7ff Latin Extended-D // 0xab30 - 0xab6f Latin Extended-E - // 0xfb00 - 0xfb4f Alphabetic Presentation Forms + // 0xfb00 - 0xfb06 Latin Alphabetic Presentation Forms // 0xff00 - 0xffef Halfwidth and Fullwidth Forms // Brahmic scripts: @@ -91,8 +91,9 @@ Script GetCharacterScript( Character character ) // 0xfe70 - 0xfeff Arabic Presentation Forms-B // 0x1ee00 - 0x1eeff Arabic Mathematical Alphabetic Symbols - // CJK and Vietnamese script. - // 0x2E80 - 0x2eff CJK Radicals Supplement + // CJK (Chinese, Japanese and Korean) and Vietnamese script. + // 0x2e80 - 0x2eff CJK Radicals Supplement + // 0x2f00 - 0x2fdf Kangxi Radicals // 0x3000 - 0x303f CJK Symbols and Punctuation // 0x3200 - 0x32ff Enclosed CJK Letters and Months // 0x3400 - 0x4dbf CJK Unified Ideographs Extension A @@ -107,8 +108,12 @@ Script GetCharacterScript( Character character ) // 0x26100 - 0x275ff CJK Unified Ideographs Extension B // 0x27600 - 0x290ff CJK Unified Ideographs Extension B // 0x29100 - 0x2a6df CJK Unified Ideographs Extension B - // 2a700-2b73f. CJK Unified Ideographs Extension C - // 2b740-2b81f. CJK Unified Ideographs Extension D + // 0x2a700 - 0x2b73f CJK Unified Ideographs Extension C + // 0x2b740 - 0x2b81f CJK Unified Ideographs Extension D + + // Japanese scripts. + // 0x3040 - 0x309f Hiragana + // 0x30a0 - 0x30ff Katakana // Hangul script // 0x1100 - 0x11ff Hangul jamo @@ -130,6 +135,10 @@ Script GetCharacterScript( Character character ) // Burmese script // 0x1000 - 0x109f Myanmar + // Hebrew script + // 0x0591 - 0x05f4 Hebrew + // 0xfb1d - 0xfb4f Hebrew subset of Alphabetic Presentation Forms + // The Emoji which map to standardized Unicode characters // 1. Emoticons ( 1F601 - 1F64F ) // 2. Dingbats ( 2702 - 27B0 ) @@ -158,6 +167,10 @@ Script GetCharacterScript( Character character ) { return LATIN; } + if( ( 0x0591 <= character ) && ( character <= 0x05f4 ) ) + { + return HEBREW; + } if( ( 0x0600 <= character ) && ( character <= 0x06ff ) ) { return ARABIC; @@ -310,10 +323,22 @@ Script GetCharacterScript( Character character ) { return CJK; } + if( ( 0x2f00 <= character ) && ( character <= 0x2fdf ) ) + { + return CJK; + } if( ( 0x3000 <= character ) && ( character <= 0x303f ) ) { return CJK; } + if( ( 0x3040 <= character ) && ( character <= 0x309f ) ) + { + return HIRAGANA; + } + if( ( 0x30a0 <= character ) && ( character <= 0x30ff ) ) + { + return KATAKANA; + } if( ( 0x3130 <= character ) && ( character <= 0x318f ) ) { return HANGUL; @@ -362,10 +387,14 @@ Script GetCharacterScript( Character character ) { return HANGUL; } - if( ( 0xfb00 <= character ) && ( character <= 0xfb4f ) ) + if( ( 0xfb00 <= character ) && ( character <= 0xfb06 ) ) { return LATIN; } + if( ( 0xfb1d <= character ) && ( character <= 0xfb4f ) ) + { + return HEBREW; + } if( ( 0xfb50 <= character ) && ( character <= 0xfdff ) ) { return ARABIC; diff --git a/text/dali/public-api/text-abstraction/script.h b/text/dali/public-api/text-abstraction/script.h index 945362b..2bbe348 100644 --- a/text/dali/public-api/text-abstraction/script.h +++ b/text/dali/public-api/text-abstraction/script.h @@ -54,6 +54,9 @@ enum Script LAO, ///< The Lao script. Used by the Lao language. THAI, ///< The Thai script. Used by the Thai language BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language. + HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic. + HIRAGANA, ///< The Hiragana script. Used by the Japanese. + KATAKANA, ///< The Katakana script. Used by the Japanese. EMOJI, ///< The Emoji which map to standardized Unicode characters. UNKNOWN ///< The script is unknown. }; @@ -78,6 +81,9 @@ const char* const ScriptName[] = "LAO", ///< The Lao script. Used by the Lao language. "THAI", ///< The Thai script. Used by the Thai language "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language. + "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic. + "HIRAGANA", ///< The Hiragana script. Used by the Japanese. + "KATAKANA", ///< The Katakana script. Used by the Japanese. "EMOJI", ///< The Emoji which map to standardized Unicode characters. "UNKNOWN" ///< The script is unknown. }; -- 2.7.4