// INTERNAL INCLUDES
#include <dali/devel-api/text-abstraction/font-list.h>
+
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/integration-api/debug.h>
} // namespace
+
+
using Dali::Vector;
namespace Dali
#ifdef ENABLE_VECTOR_BASED_TEXT_RENDERING
mVectorFontCache = new VectorFontCache( mFreeTypeLibrary );
#endif
+
}
FontClient::Plugin::~Plugin()
FT_Done_FreeType( mFreeTypeLibrary );
}
+void FontClient::Plugin::ClearCache()
+{
+ mDefaultFontDescription = FontDescription();
+
+ mSystemFonts.clear();
+ mDefaultFonts.clear();
+
+ DestroyCharacterSets( mDefaultFontCharacterSets );
+ mDefaultFontCharacterSets.Clear();
+
+ ClearFallbackCache( mFallbackCache );
+ mFallbackCache.clear();
+
+ mFontIdCache.Clear();
+
+ ClearCharacterSetFromFontFaceCache();
+ mFontFaceCache.clear();
+
+ mValidatedFontCache.clear();
+ mFontDescriptionCache.clear();
+ mFontDescriptionCache.resize( 1u );
+
+ DestroyCharacterSets( mCharacterSetCache );
+ mCharacterSetCache.Clear();
+ mCharacterSetCache.Resize( 1u );
+
+ mFontDescriptionSizeCache.clear();
+
+ mEllipsisCache.Clear();
+ mPixelBufferCache.clear();
+ mEmbeddedItemCache.Clear();
+ mBitmapFontCache.clear();
+
+ mDefaultFontDescriptionCached = false;
+}
+
void FontClient::Plugin::SetDpi( unsigned int horizontalDpi,
unsigned int verticalDpi )
{
false );
fontFaceId = mFontIdCache[fontId-1u].id;
- mFontFaceCache[fontFaceId].mCharacterSet = mCharacterSetCache[validatedFontId];
+ mFontFaceCache[fontFaceId].mCharacterSet = FcCharSetCopy( mCharacterSetCache[validatedFontId] );
// Cache the pair 'validatedFontId, requestedPointSize' to improve the following queries.
mFontDescriptionSizeCache.push_back( FontDescriptionSizeCacheItem( validatedFontId,
bool FontClient::Plugin::AddCustomFontDirectory( const FontPath& path )
{
- // NULL as first parameter means the current configuration is used.
- return FcConfigAppFontAddDir( NULL, reinterpret_cast<const FcChar8 *>( path.c_str() ) );
+ // nullptr as first parameter means the current configuration is used.
+ return FcConfigAppFontAddDir( nullptr, reinterpret_cast<const FcChar8 *>( path.c_str() ) );
}
GlyphIndex FontClient::Plugin::CreateEmbeddedItem( const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat )
FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast<const FcChar8*>( fontDescription.family.c_str() ) );
// add a property to the pattern for local setting.
- const char* locale = setlocale( LC_MESSAGES, NULL );
- if( locale != NULL)
+ const char* locale = setlocale( LC_MESSAGES, nullptr );
+ if( locale != nullptr)
{
FcPatternAddString( fontFamilyPattern, FC_LANG, reinterpret_cast<const FcChar8*>( locale ) );
}