X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Ftext%2Ftext-abstraction%2Ffont-client-plugin-impl.cpp;h=14efb7b56135101d22c5f6c2acbf365035b57bb7;hb=e4634bbf698ca3b79f1f7e8cb5dda23a784df10e;hp=6b1e49153ff96752200415db119144646a125ab6;hpb=5f08bc47ee442349fa03b9d2459328d814eb0c2e;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp index 6b1e491..14efb7b 100644 --- a/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp +++ b/dali/internal/text/text-abstraction/font-client-plugin-impl.cpp @@ -252,7 +252,7 @@ FontClient::Plugin::~Plugin() #ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING delete mVectorFontCache; #endif - + DestroyMatchedPatterns(); FT_Done_FreeType( mFreeTypeLibrary ); } @@ -1009,7 +1009,7 @@ bool FontClient::Plugin::GetBitmapMetrics( GlyphInfo* array, else #endif { - int error = FT_Load_Glyph( ftFace, glyph.index, FT_LOAD_DEFAULT ); + int error = FT_Load_Glyph( ftFace, glyph.index, FT_LOAD_NO_AUTOHINT ); if( FT_Err_Ok == error ) { @@ -1102,7 +1102,7 @@ void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dal else #endif { - error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_DEFAULT ); + error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_NO_AUTOHINT ); } if( FT_Err_Ok == error ) { @@ -1955,9 +1955,9 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do FcCharSet* characterSet = NULL; FcPatternGetCharSet( match, FC_CHARSET, 0u, &characterSet ); - FcPatternDestroy( match ); FcPatternDestroy( pattern ); + mMatchedFcPatternCache.PushBack( match ); mFontCache[id-1u].mCharacterSet = characterSet; // Add the path to the cache. @@ -1977,7 +1977,7 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do } } -FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description ) const +FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description ) { FcCharSet* characterSet = NULL; @@ -1989,14 +1989,22 @@ FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDesc FcPattern* match = FcFontMatch( NULL, pattern, &result ); FcPatternGetCharSet( match, FC_CHARSET, 0u, &characterSet ); + mMatchedFcPatternCache.PushBack( match ); - FcPatternDestroy( match ); FcPatternDestroy( pattern ); } return characterSet; } +void FontClient::Plugin::DestroyMatchedPatterns() +{ + for (auto & object : mMatchedFcPatternCache) { + FcPatternDestroy(reinterpret_cast(object)); + } + mMatchedFcPatternCache.Clear(); +} + } // namespace Internal } // namespace TextAbstraction