X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmulti-language-support-impl.cpp;h=4c68a74d5bd6613f97bd7aa26d9c06eb468a63b6;hb=3047bf4954ccfd8f4d185dc79fe2128b088315b9;hp=711b7c3813cfdb2c27d715d20d0636c1779ba338;hpb=b72975a0ce87da47181d23541e78e83b30a7dbc9;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index 711b7c3..4c68a74 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -23,11 +23,11 @@ #include #include #include +#include // INTERNAL INCLUDES #include #include -#include #include namespace Dali @@ -134,13 +134,13 @@ Script GetScript( Length index, */ bool IsValidForAllScripts( Character character ) { - return ( IsWhiteSpace( character ) || - IsZeroWidthNonJoiner( character ) || - IsZeroWidthJoiner( character ) || - IsZeroWidthSpace( character ) || - IsLeftToRightMark( character ) || - IsRightToLeftMark( character ) || - IsThinSpace( character ) ); + return ( TextAbstraction::IsWhiteSpace( character ) || + TextAbstraction::IsZeroWidthNonJoiner( character ) || + TextAbstraction::IsZeroWidthJoiner( character ) || + TextAbstraction::IsZeroWidthSpace( character ) || + TextAbstraction::IsLeftToRightMark( character ) || + TextAbstraction::IsRightToLeftMark( character ) || + TextAbstraction::IsThinSpace( character ) ); } bool ValidateFontsPerScript::FindValidFont( FontId fontId ) const @@ -294,14 +294,14 @@ void MultilanguageSupport::SetScripts( const Vector& text, } // Get the script of the character. - Script script = GetCharacterScript( character ); + Script script = TextAbstraction::GetCharacterScript( character ); // Check if it is the first character of a paragraph. if( firstValidScript && ( TextAbstraction::UNKNOWN != script ) ) { // Sets the direction of the first valid script. - isParagraphRTL = ( TextAbstraction::ARABIC == script ); + isParagraphRTL = TextAbstraction::IsRightToLeftScript( script ); firstValidScript = false; } @@ -309,7 +309,7 @@ void MultilanguageSupport::SetScripts( const Vector& text, { // Current run needs to be stored and a new one initialized. - if( isParagraphRTL != ( TextAbstraction::ARABIC == script ) ) + if( isParagraphRTL != TextAbstraction::IsRightToLeftScript( script ) ) { // Current script has different direction than the first script of the paragraph. // All the previously skipped characters need to be added to the previous script before it's stored. @@ -505,8 +505,11 @@ void MultilanguageSupport::ValidateFonts( const Vector& text, // If the cache has not a default font, get one from the font client. if( 0u == fontId ) { + // Emojis are present in many monochrome fonts; prefer color by default. + bool preferColor = ( TextAbstraction::EMOJI == script ); + // Find a default font. - fontId = fontClient.FindDefaultFont( character, pointSize ); + fontId = fontClient.FindDefaultFont( character, pointSize, preferColor ); // If the system does not support a suitable font, fallback to Latin if( 0u == fontId )