X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-view%2Ftext-view-word-processor.cpp;h=e1239307ffcf64b7066b2f9d0d8d462ba22ed6f5;hp=94a2998fda894adf662addd6edb5e10d961878a7;hb=31f8b86ac06be7e61fe3a8637c27e55f12e41168;hpb=86202cf2dbd203142c38e55ed38429d9aa005f75;ds=sidebyside diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp b/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp index 94a2998..e123930 100644 --- a/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp +++ b/base/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp @@ -37,6 +37,8 @@ namespace TextViewProcessor namespace { +const std::string EMOJI_FONT_NAME( "SamsungEmoji" ); // Emoticons font family name. + /** * Updates the word size and ascender. * @@ -115,19 +117,26 @@ void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word, Character character = styledText.mText[index]; styledCharacter.mText.Append( character ); - //Choose the right font for the given character and style. - ChooseFontFamilyName( styledCharacter ); - - const Font font = Font::New( FontParameters( styledCharacter.mStyle.GetFontName(), styledCharacter.mStyle.GetFontStyle(), styledCharacter.mStyle.GetFontPointSize() ) ); - const Font::Metrics metrics = font.GetMetrics( character ); - const float ascender = font.GetAscender(); - // Create layout character info. CharacterLayoutInfo characterLayoutInfo; characterLayoutInfo.mIsColorGlyph = GlyphImage::IsColorGlyph( character ); DALI_LOG_INFO( gTextViewProcessorLogFilter, Debug::General, " Is color glyph: %s\n", ( characterLayoutInfo.mIsColorGlyph ? "True" : "False" ) ); + if( characterLayoutInfo.mIsColorGlyph ) + { + styledCharacter.mStyle.SetFontName( EMOJI_FONT_NAME ); + } + else + { + //Choose the right font for the given character and style. + ChooseFontFamilyName( styledCharacter ); + } + + const Font font = Font::New( FontParameters( styledCharacter.mStyle.GetFontName(), styledCharacter.mStyle.GetFontStyle(), styledCharacter.mStyle.GetFontPointSize() ) ); + const Font::Metrics metrics = font.GetMetrics( character ); + const float ascender = font.GetAscender(); + // Fill Natural size info for current character. characterLayoutInfo.mHeight = font.GetLineHeight(); characterLayoutInfo.mAdvance = metrics.GetAdvance();