- // Emojis are present in many monochrome fonts; prefer color by default.
- bool preferColor = ( TextAbstraction::EMOJI == script );
-
- // Find a fallback-font.
- fontId = fontClient.FindFallbackFont( preferredFont, character, currentPointSize, preferColor );
-
- // If the system does not support a suitable font, fallback to Latin
- DefaultFonts* latinDefaults = NULL;
- if( 0u == fontId )
- {
- latinDefaults = *( defaultFontPerScriptCacheBuffer + TextAbstraction::LATIN );
- if( NULL != latinDefaults )
- {
- fontId = latinDefaults->FindFont( fontClient, currentPointSize );
- }
- }
-
- if( 0u == fontId )
- {
- fontId = fontClient.FindDefaultFont( UTF32_A, currentPointSize );
- }
-
- // Cache the font.
- if( NULL == latinDefaults )
- {
- latinDefaults = new DefaultFonts();
- *( defaultFontPerScriptCacheBuffer + script ) = latinDefaults;
- }
- latinDefaults->mFonts.PushBack( fontId );