#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
delete mVectorFontCache;
#endif
-
+ DestroyMatchedPatterns();
FT_Done_FreeType( mFreeTypeLibrary );
}
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 )
{
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 )
{
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.
}
}
-FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description ) const
+FcCharSet* FontClient::Plugin::CreateCharacterSetFromDescription( const FontDescription& description )
{
FcCharSet* characterSet = NULL;
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<FcPattern*>(object));
+ }
+ mMatchedFcPatternCache.Clear();
+}
+
} // namespace Internal
} // namespace TextAbstraction