+ // Validate whether the current character is supported by the given font.
+ bool isValidFont = false;
+
+ // Check first in the cache of default fonts per script and size.
+
+ FontId cachedDefaultFontId = 0u;
+ DefaultFonts* defaultFonts = *(defaultFontPerScriptCacheBuffer + script);
+ if(NULL != defaultFonts)
+ {
+ // This cache stores fall-back fonts.
+ cachedDefaultFontId = defaultFonts->FindFont(fontClient,
+ currentFontDescription,
+ currentFontPointSize);
+ }
+
+ // Whether the cached default font is valid.
+ const bool isValidCachedDefaultFont = 0u != cachedDefaultFontId;
+
+ // The font is valid if it matches with the default one for the current script and size and it's different than zero.
+ isValidFont = isValidCachedDefaultFont && (fontId == cachedDefaultFontId);
+
+ if(isValidFont)
+ {
+ // Check if the font supports the character.
+ isValidFont = fontClient.IsCharacterSupportedByFont(fontId, character);
+ }
+
+ bool isCommonScript = false;
+ bool isEmojiScript = TextAbstraction::EMOJI == script;