+
+ return fontId;
+}
+
+FontId FontClient::Plugin::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindDefaultFont DefaultFontsList(%s)\n", (mDefaultFonts.empty()?"empty":"created") );
+
+ FontId fontId(0);
+
+ // Create the list of default fonts if it has not been created.
+ if( mDefaultFonts.empty() )
+ {
+ FontDescription fontDescription;
+ fontDescription.family = DEFAULT_FONT_FAMILY_NAME;
+ fontDescription.width = IntToWidthType( DEFAULT_FONT_WIDTH );
+ fontDescription.weight = IntToWeightType( DEFAULT_FONT_WEIGHT );
+ fontDescription.slant = IntToSlantType( DEFAULT_FONT_SLANT );
+
+ SetFontList( fontDescription, mDefaultFonts );
+ }
+
+ // Traverse the list of default fonts.
+ // Check for each default font if supports the character.
+ fontId = FindFontForCharacter( mDefaultFonts, charcode, requestedPointSize, preferColor );
+
+ return fontId;
+}
+
+FontId FontClient::Plugin::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
+{
+ // The font id to be returned.
+ FontId fontId = 0u;
+
+ FontDescription fontDescription;
+
+ // Fill the font description with the preferred font description and complete with the defaults.
+ fontDescription.family = preferredFontDescription.family.empty() ? DEFAULT_FONT_FAMILY_NAME : preferredFontDescription.family;
+ fontDescription.weight = ( ( FontWeight::NONE == preferredFontDescription.weight ) ? IntToWeightType( DEFAULT_FONT_WEIGHT ) : preferredFontDescription.weight );
+ fontDescription.width = ( ( FontWidth::NONE == preferredFontDescription.width ) ? IntToWidthType( DEFAULT_FONT_WIDTH ) : preferredFontDescription.width );
+ fontDescription.slant = ( ( FontSlant::NONE == preferredFontDescription.slant ) ? IntToSlantType( DEFAULT_FONT_SLANT ) : preferredFontDescription.slant );
+
+ // Check first if the font's description has been queried before.
+ FontList* fontList( NULL );
+
+ if( !FindFallbackFontList( fontDescription, fontList ) )
+ {
+ fontList = new FontList;
+ SetFontList( fontDescription, *fontList );
+
+ // Add the font-list to the cache.
+ mFallbackCache.push_back( FallbackCacheItem( fontDescription, fontList ) );
+ }
+
+ if( fontList )
+ {
+ fontId = FindFontForCharacter( *fontList, charcode, requestedPointSize, preferColor );
+ }
+