float descender; ///< The descender in pixels. Minimum descender of all the glyphs.
float underlinePosition; ///< The position in pixels of the underline from the base line.
float underlineThickness; ///< The thickness in pixels of the underline.
+ bool isColorFont:1; ///< Whether the glyphs of this font have their own colors.
};
} // namespace TextAbstraction
*/
~GlyphBufferData();
- unsigned char* buffer; ///< The glyph's bitmap buffer data.
- unsigned int width; ///< The width of the bitmap.
- unsigned int height; ///< The height of the bitmap.
- Pixel::Format format; ///< The pixel's format of the bitmap.
+ unsigned char* buffer; ///< The glyph's bitmap buffer data.
+ unsigned int width; ///< The width of the bitmap.
+ unsigned int height; ///< The height of the bitmap.
+ Pixel::Format format; ///< The pixel's format of the bitmap.
+ bool isColorEmoji:1; ///< Whether the glyph is an emoji.
+ bool isColorBitmap:1; ///< Whether the glyph is a color bitmap.
};
/**
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
if( ( fontId > 0u ) &&
( index < mFontIdCache.Count() ) )
{
+ data.isColorBitmap = false;
+ data.isColorEmoji = false;
+
const FontIdCacheItem& fontIdCacheItem = mFontIdCache[index];
switch( fontIdCacheItem.type )
ConvertBitmap( data, ftFace->glyph->bitmap, isShearRequired );
}
+ data.isColorEmoji = fontFaceCacheItem.mIsFixedSizeBitmap;
+
// Created FT_Glyph object must be released with FT_Done_Glyph
FT_Done_Glyph( glyph );
}
data.width = pixelBuffer.GetWidth();
data.height = pixelBuffer.GetHeight();
+ data.isColorBitmap = bitmapFontCacheItem.font.isColorFont;
+
ConvertBitmap( data, data.width, data.height, pixelBuffer.GetBuffer() );
// Sets the pixel format.
const FontId index = fontId - 1u;
-#ifdef FREETYPE_BITMAP_SUPPORT
if( ( fontId > 0u ) &&
( index < mFontIdCache.Count() ) )
{
{
case FontDescription::FACE_FONT:
{
+#ifdef FREETYPE_BITMAP_SUPPORT
const FontFaceCacheItem& item = mFontFaceCache[fontIdCacheItem.id];
FT_Face ftFace = item.mFreeTypeFace;
{
error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_COLOR );
}
+#endif
break;
}
case FontDescription::BITMAP_FONT:
}
}
}
-#endif
return FT_Err_Ok == error;
}