+bool FontClient::Plugin::IsCharacterSupportedByFont( FontId fontId, Character character )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::General, "-->FontClient::Plugin::IsCharacterSupportedByFont\n");
+ DALI_LOG_INFO( gLogFilter, Debug::General, " font id : %d\n", fontId );
+ DALI_LOG_INFO( gLogFilter, Debug::General, " character : %p\n", character );
+
+ if( ( fontId < 1u ) || ( fontId > mFontFaceCache.size() ) )
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::General, " Invalid font id. Number of items in the cache: %d\n",mFontFaceCache.size());
+ DALI_LOG_INFO( gLogFilter, Debug::General, "<--FontClient::Plugin::IsCharacterSupportedByFont\n");
+ return false;
+ }
+
+ --fontId;
+
+ bool isSupported = false;
+
+ FontFaceCacheItem& cacheItem = mFontFaceCache[fontId];
+
+ if( nullptr == cacheItem.mCharacterSet )
+ {
+ // Create again the character set.
+ // It can be null if the ResetSystemDefaults() method has been called.
+
+ FontDescription description;
+ description.path = cacheItem.mPath;
+ description.family = std::move( FontFamily( cacheItem.mFreeTypeFace->family_name ) );
+ description.weight = FontWeight::NONE;
+ description.width = FontWidth::NONE;
+ description.slant = FontSlant::NONE;
+
+ // Note FreeType doesn't give too much info to build a proper font style.
+ if( cacheItem.mFreeTypeFace->style_flags & FT_STYLE_FLAG_ITALIC )
+ {
+ description.slant = FontSlant::ITALIC;
+ }
+ if( cacheItem.mFreeTypeFace->style_flags & FT_STYLE_FLAG_BOLD )
+ {
+ description.weight = FontWeight::BOLD;
+ }
+
+ cacheItem.mCharacterSet = CreateCharacterSetFromDescription( description );
+ }
+
+ isSupported = FcCharSetHasChar( cacheItem.mCharacterSet, character );
+
+ DALI_LOG_INFO( gLogFilter, Debug::General, " is supported : %s\n", (isSupported ? "true" : "false") );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "<--FontClient::Plugin::IsCharacterSupportedByFont\n");
+ return isSupported;
+}
+