const FontId& cachedDefaultFontId,
const TextAbstraction::FontDescription& currentFontDescription,
const TextAbstraction::PointSize26Dot6& currentFontPointSize,
- DefaultFonts**& defaultFontPerScriptCacheBuffer)
+ DefaultFonts**& defaultFontPerScriptCacheBuffer,
+ bool findFallbackFont)
{
// Need to check if the given font supports the current character.
- if(!isValidFont) // (1)
+ if(!isValidFont && !findFallbackFont) // (1)
{
// Whether the current character is common for all scripts (i.e. white spaces, ...)
} // !isValidFont (3)
} // !isValidFont (2)
} // !isValidFont (1)
+ else if(!isValidFont && findFallbackFont)
+ {
+ // Find a fallback-font.
+ fontId = fontClient.FindFallbackFont(character,
+ currentFontDescription,
+ currentFontPointSize,
+ false);
+
+ if(0u == fontId)
+ {
+ fontId = fontClient.FindDefaultFont(character, currentFontPointSize);
+ }
+ isValidFont = true;
+ }
}
} // unnamed namespace
void ValidateFontsPerScript::Cache(FontId fontId)
{
mValidFonts.PushBack(fontId);
-
return;
}
isValidFont = true;
}
+ bool findFallbackFont = false;
+ if(TextAbstraction::IsEmojiVariationSequences(character) && !TextAbstraction::IsASCIIDigits(character))
+ {
+ if(index + 1 <= lastCharacter)
+ {
+ const Character nextCharacter = *(textBuffer + index + 1);
+ findFallbackFont = (!TextAbstraction::IsEmojiPresentationSelector(nextCharacter) && !TextAbstraction::IsTextPresentationSelector(nextCharacter) &&
+ !TextAbstraction::IsZeroWidthJoiner(nextCharacter) && !TextAbstraction::IsEmojiModifier(nextCharacter));
+ }
+ else if(index == lastCharacter)
+ {
+ findFallbackFont = true;
+ }
+ }
+
// This is valid after CheckFontSupportsCharacter();
bool isCommonScript = false;
// Need to check if the given font supports the current character.
CheckFontSupportsCharacter(isValidFont, isCommonScript, character, validFontsPerScriptCacheBuffer, script, fontId, fontClient,
- isValidCachedDefaultFont, cachedDefaultFontId, currentFontDescription, currentFontPointSize, defaultFontPerScriptCacheBuffer);
+ isValidCachedDefaultFont, cachedDefaultFontId, currentFontDescription, currentFontPointSize, defaultFontPerScriptCacheBuffer, findFallbackFont);
if(isEmojiScript && (previousScript != script))
{