/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
currentFontId = fontId;
// Get the script for the current character.
- const Script script = GetScript( index,
- scriptRunIt,
- scriptRunEndIt );
+ Script script = GetScript( index,
+ scriptRunIt,
+ scriptRunEndIt );
#ifdef DEBUG_ENABLED
{
description.path.c_str() );
}
#endif
+ if (script == TextAbstraction::UNKNOWN)
+ {
+ script = TextAbstraction::LATIN;
+ }
// Validate whether the current character is supported by the given font.
bool isValidFont = false;
if( isValidFont &&
isEmojiScript )
{
- const PixelData bitmap = fontClient.CreateBitmap( fontId, glyphIndex );
-
- // For color emojis, the font is valid if the bitmap is RGBA.
- isValidFont = bitmap && ( Pixel::BGRA8888 == bitmap.GetPixelFormat() );
+ // For color emojis, the font is valid if the glyph is a color glyph (the bitmap is RGBA).
+ isValidFont = fontClient.IsColorGlyph( fontId, glyphIndex );
}
// If there is a valid font, cache it.
if( !isValidFont ) // (3)
{
// The given font has not been validated.
+ int validCharacterIndex = fontClient.GetGlyphIndex(cachedDefaultFontId, character );
- if( isValidCachedDefaultFont )
+ if( isValidCachedDefaultFont && validCharacterIndex != 0u )
{
// Use the cached default font for the script if there is one.
fontId = cachedDefaultFontId;