- // Emojis are present in many monochrome fonts; prefer color by default.
- if( TextAbstraction::EMOJI == script &&
- 0u != glyphIndex )
+ *( validFontsPerScriptCacheBuffer + script ) = validateFontsPerScript;
+ }
+
+ validateFontsPerScript->mValidFonts.PushBack( fontId );
+ }
+
+ if( !isValidFont && ( fontId != cachedDefaultFontId ) && ( !TextAbstraction::IsNewParagraph( character ) )) // (3)
+ {
+ // The selected font by the user or the platform's default font has failed to validate the character.
+
+ // Checks if the previously discarted cached default font supports the character.
+ bool isValidCachedFont = false;
+ if( isValidCachedDefaultFont )
+ {
+ isValidCachedFont = fontClient.IsCharacterSupportedByFont( cachedDefaultFontId, character );
+ }
+
+ if( isValidCachedFont )
+ {
+ // Use the cached default font for the script if there is one.
+ fontId = cachedDefaultFontId;
+ }
+ else
+ {
+ // There is no valid cached default font for the script.
+
+ DefaultFonts* defaultFontsPerScript = NULL;
+
+ // Find a fallback-font.
+ fontId = fontClient.FindFallbackFont( character,
+ currentFontDescription,
+ currentFontPointSize,
+ false );
+
+ if( 0u == fontId )