From ecba8c169acadd29e7728a2771d33e86e2f0d9ac Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Fri, 17 Feb 2017 15:43:49 +0000 Subject: [PATCH] [3.0] New methods added to the font-client. * IsColorGlyph queries whether a glyph is a color one without retrieving the bitmap. * CreateBitmap retrieves the raw data of a glyph's bitmap. Change-Id: I8a2d943593378ecd024c9a034071845cf9d45d89 Signed-off-by: Victor Cebollada --- .../devel-api/text-abstraction/font-client.cpp | 22 ++++++ text/dali/devel-api/text-abstraction/font-client.h | 44 +++++++++++ .../internal/text-abstraction/font-client-impl.cpp | 14 ++++ .../internal/text-abstraction/font-client-impl.h | 56 ++++++++------ .../text-abstraction/font-client-plugin-impl.cpp | 88 +++++++++++++++------- .../text-abstraction/font-client-plugin-impl.h | 65 +++++++++------- 6 files changed, 210 insertions(+), 79 deletions(-) diff --git a/text/dali/devel-api/text-abstraction/font-client.cpp b/text/dali/devel-api/text-abstraction/font-client.cpp index e8fba7f..cc00057 100644 --- a/text/dali/devel-api/text-abstraction/font-client.cpp +++ b/text/dali/devel-api/text-abstraction/font-client.cpp @@ -29,6 +29,18 @@ namespace TextAbstraction const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64 +FontClient::GlyphBufferData::GlyphBufferData() +: buffer( NULL ), + width( 0u ), + height( 0u ), + format( Pixel::A8 ) +{ +} + +FontClient::GlyphBufferData::~GlyphBufferData() +{ +} + FontClient FontClient::Get() { return Internal::FontClient::Get(); @@ -160,6 +172,11 @@ bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType typ return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal ); } +void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data ) +{ + GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data ); +} + PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) { return GetImplementation(*this).CreateBitmap( fontId, glyphIndex ); @@ -175,6 +192,11 @@ const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSiz return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize ); } +bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ) +{ + return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex ); +} + FontClient::FontClient( Internal::FontClient* internal ) : BaseHandle( internal ) { diff --git a/text/dali/devel-api/text-abstraction/font-client.h b/text/dali/devel-api/text-abstraction/font-client.h index 885fe6c..4fa85ca 100644 --- a/text/dali/devel-api/text-abstraction/font-client.h +++ b/text/dali/devel-api/text-abstraction/font-client.h @@ -64,6 +64,29 @@ class DALI_IMPORT_API FontClient : public BaseHandle public: static const PointSize26Dot6 DEFAULT_POINT_SIZE; ///< The default point size. + /** + * @brief Struct used to retrieve the glyph's bitmap. + */ + struct GlyphBufferData + { + /** + * @brief Constructor. + * + * Initializes struct members to their defaults. + */ + GlyphBufferData(); + + /** + * @brief Destructor. + */ + ~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. + }; + public: /** @@ -306,6 +329,17 @@ public: /** * @brief Create a bitmap representation of a glyph. * + * @note The caller is responsible for deallocating the bitmap data @p data.buffer using delete[]. + * + * @param[in] fontId The identifier of the font. + * @param[in] glyphIndex The index of a glyph within the specified font. + * @param[out] data The bitmap data. + */ + void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data ); + + /** + * @brief Create a bitmap representation of a glyph. + * * @param[in] fontId The identifier of the font. * @param[in] glyphIndex The index of a glyph within the specified font. * @@ -340,6 +374,16 @@ public: */ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize ); + /** + * @brief Whether the given glyph @p glyphIndex is a color glyph. + * + * @param[in] fontId The font id. + * @param[in] glyphIndex The glyph index. + * + * @return @e true if the glyph is a color one. + */ + bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ); + public: // Not intended for application developers /** * @brief This constructor is used by FontClient::Get(). diff --git a/text/dali/internal/text-abstraction/font-client-impl.cpp b/text/dali/internal/text-abstraction/font-client-impl.cpp index 040c557..833dfdc 100644 --- a/text/dali/internal/text-abstraction/font-client-impl.cpp +++ b/text/dali/internal/text-abstraction/font-client-impl.cpp @@ -224,6 +224,13 @@ bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType typ return mPlugin->GetGlyphMetrics( array, size, type, horizontal ); } +void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ) +{ + CreatePlugin(); + + mPlugin->CreateBitmap( fontId, glyphIndex, data ); +} + PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) { CreatePlugin(); @@ -245,6 +252,13 @@ const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSiz return mPlugin->GetEllipsisGlyph( requestedPointSize ); } +bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ) +{ + CreatePlugin(); + + return mPlugin->IsColorGlyph( fontId, glyphIndex ); +} + void FontClient::CreatePlugin() { if( !mPlugin ) diff --git a/text/dali/internal/text-abstraction/font-client-impl.h b/text/dali/internal/text-abstraction/font-client-impl.h index 555fca8..f5afa98 100644 --- a/text/dali/internal/text-abstraction/font-client-impl.h +++ b/text/dali/internal/text-abstraction/font-client-impl.h @@ -51,59 +51,59 @@ public: ~FontClient(); /** - * @copydoc Dali::FontClient::Get() + * @copydoc Dali::TextAbstraction::FontClient::Get() */ static Dali::TextAbstraction::FontClient Get(); /** - * @copydoc Dali::FontClient::SetDpi() + * @copydoc Dali::TextAbstraction::FontClient::SetDpi() */ void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi ); /** - * @copydoc Dali::FontClient::GetDpi() + * @copydoc Dali::TextAbstraction::FontClient::GetDpi() */ void GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi ); /** - * @copydoc Dali::FontClient::ResetSystemDefaults() + * @copydoc Dali::TextAbstraction::FontClient::ResetSystemDefaults() */ void ResetSystemDefaults(); /** - * @copydoc Dali::FontClient::GetDefaultFonts() + * @copydoc Dali::TextAbstraction::FontClient::GetDefaultFonts() */ void GetDefaultFonts( FontList& defaultFonts ); /** - * @copydoc Dali::FontClient::GetDefaultPlatformFontDescription() + * @copydoc Dali::TextAbstraction::FontClient::GetDefaultPlatformFontDescription() */ void GetDefaultPlatformFontDescription( FontDescription& fontDescription ); /** - * @copydoc Dali::FontClient::GetSystemFonts() + * @copydoc Dali::TextAbstraction::FontClient::GetSystemFonts() */ void GetSystemFonts( FontList& systemFonts ); /** - * @copydoc Dali::FontClient::GetDescription() + * @copydoc Dali::TextAbstraction::FontClient::GetDescription() */ void GetDescription( FontId id, FontDescription& fontDescription ); /** - * @copydoc Dali::FontClient::GetPointSize() + * @copydoc Dali::TextAbstraction::FontClient::GetPointSize() */ PointSize26Dot6 GetPointSize( FontId id ); /** - * @copydoc Dali::FontClient::FindDefaultFont() + * @copydoc Dali::TextAbstraction::FontClient::FindDefaultFont() */ FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor ); /** - * @copydoc Dali::FontClient::FindFallbackFont() + * @copydoc Dali::TextAbstraction::FontClient::FindFallbackFont() */ FontId FindFallbackFont( Character charcode, const FontDescription& preferredFontDescription, @@ -111,68 +111,78 @@ public: bool preferColor ); /** - * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) + * @copydoc Dali::TextAbstraction::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) */ FontId GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ); /** - * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) + * @copydoc Dali::TextAbstraction::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) */ FontId GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ); /** - * @copydoc Dali::FontClient::IsScalable( const FontPath& path ) + * @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontPath& path ) */ bool IsScalable( const FontPath& path ); /** - * @copydoc Dali::FontClient::IsScalable( const FontDescription& fontDescription ) + * @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontDescription& fontDescription ) */ bool IsScalable( const FontDescription& fontDescription ); /** - * @copydoc Dali::FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ) + * @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ) */ void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ); /** - * @copydoc Dali::FontClient::GetFixedSizes() + * @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes() */ void GetFixedSizes( const FontDescription& fontDescription, Dali::Vector< PointSize26Dot6 >& sizes ); /** - * @copydoc Dali::FontClient::GetFontMetrics() + * @copydoc Dali::TextAbstraction::FontClient::GetFontMetrics() */ void GetFontMetrics( FontId fontId, FontMetrics& metrics ); /** - * @copydoc Dali::FontClient::GetGlyphIndex() + * @copydoc Dali::TextAbstraction::FontClient::GetGlyphIndex() */ GlyphIndex GetGlyphIndex( FontId fontId, Character charcode ); /** - * @copydoc Dali::FontClient::GetGlyphMetrics() + * @copydoc Dali::TextAbstraction::FontClient::GetGlyphMetrics() */ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal ); /** - * @copydoc Dali::FontClient::CreateBitmap() + * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ) + */ + void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ); + + /** + * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) */ PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex ); /** - * @copydoc Dali::FontClient::CreateVectorBlob() + * @copydoc Dali::TextAbstraction::FontClient::CreateVectorBlob() */ void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight ); /** - * @copydoc Dali::FontClient::GetEllipsisGlyph() + * @copydoc Dali::TextAbstraction::FontClient::GetEllipsisGlyph() */ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize ); + /** + * @copydoc Dali::TextAbstraction::FontClient::IsColorGlyph() + */ + bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ); + private: /** diff --git a/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp b/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp index 56e297c..1ba5361 100644 --- a/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp +++ b/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp @@ -461,12 +461,7 @@ FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList, if( preferColor ) { - PixelData bitmap = CreateBitmap( fontId, GetGlyphIndex(fontId,charcode) ); - if( bitmap && - Pixel::BGRA8888 == bitmap.GetPixelFormat() ) - { - foundColor = true; - } + foundColor = IsColorGlyph( fontId, GetGlyphIndex( fontId, charcode ) ); } // Keep going unless we prefer a different (color) font. @@ -879,21 +874,18 @@ bool FontClient::Plugin::GetVectorMetrics( GlyphInfo* array, #endif } -PixelData FontClient::Plugin::CreateBitmap( FontId fontId, - GlyphIndex glyphIndex ) +void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ) { - PixelData bitmap; - - if( fontId > 0 && - fontId-1 < mFontCache.size() ) + if( ( fontId > 0 ) && + ( fontId - 1u < mFontCache.size() ) ) { - FT_Face ftFace = mFontCache[fontId-1].mFreeTypeFace; + FT_Face ftFace = mFontCache[fontId - 1u].mFreeTypeFace; FT_Error error; #ifdef FREETYPE_BITMAP_SUPPORT // Check to see if this is fixed size bitmap - if ( mFontCache[fontId-1].mIsFixedSizeBitmap ) + if ( mFontCache[fontId - 1u].mIsFixedSizeBitmap ) { error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_COLOR ); } @@ -916,7 +908,7 @@ PixelData FontClient::Plugin::CreateBitmap( FontId fontId, if ( FT_Err_Ok == error ) { FT_BitmapGlyph bitmapGlyph = (FT_BitmapGlyph)glyph; - ConvertBitmap( bitmap, bitmapGlyph->bitmap ); + ConvertBitmap( data, bitmapGlyph->bitmap ); } else { @@ -925,7 +917,7 @@ PixelData FontClient::Plugin::CreateBitmap( FontId fontId, } else { - ConvertBitmap( bitmap, ftFace->glyph->bitmap ); + ConvertBitmap( data, ftFace->glyph->bitmap ); } // Created FT_Glyph object must be released with FT_Done_Glyph @@ -937,8 +929,21 @@ PixelData FontClient::Plugin::CreateBitmap( FontId fontId, DALI_LOG_ERROR( "FT_Load_Glyph Failed with error: %d\n", error ); } } +} - return bitmap; +PixelData FontClient::Plugin::CreateBitmap( FontId fontId, + GlyphIndex glyphIndex ) +{ + TextAbstraction::FontClient::GlyphBufferData data; + + CreateBitmap( fontId, glyphIndex, data ); + + return PixelData::New( data.buffer, + data.width * data.height * Pixel::GetBytesPerPixel( data.format ), + data.width, + data.height, + data.format, + PixelData::DELETE_ARRAY ); } void FontClient::Plugin::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight ) @@ -999,6 +1004,28 @@ const GlyphInfo& FontClient::Plugin::GetEllipsisGlyph( PointSize26Dot6 requested return item.glyph; } +bool FontClient::Plugin::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ) +{ + FT_Error error = -1; + +#ifdef FREETYPE_BITMAP_SUPPORT + if( ( fontId > 0 ) && + ( fontId - 1u < mFontCache.size() ) ) + { + const FontFaceCacheItem& item = mFontCache[fontId - 1u]; + FT_Face ftFace = item.mFreeTypeFace; + + // Check to see if this is fixed size bitmap + if( item.mIsFixedSizeBitmap ) + { + error = FT_Load_Glyph( ftFace, glyphIndex, FT_LOAD_COLOR ); + } + } +#endif + + return FT_Err_Ok == error; +} + void FontClient::Plugin::InitSystemFonts() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::InitSystemFonts \n"); @@ -1294,8 +1321,7 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path, return id; } -void FontClient::Plugin::ConvertBitmap( PixelData& destBitmap, - FT_Bitmap srcBitmap ) +void FontClient::Plugin::ConvertBitmap( TextAbstraction::FontClient::GlyphBufferData& data, FT_Bitmap srcBitmap ) { if( srcBitmap.width*srcBitmap.rows > 0 ) { @@ -1303,12 +1329,14 @@ void FontClient::Plugin::ConvertBitmap( PixelData& destBitmap, { case FT_PIXEL_MODE_GRAY: { - if( srcBitmap.pitch == static_cast< int >( srcBitmap.width ) ) + if( srcBitmap.pitch == static_cast( srcBitmap.width ) ) { - unsigned int bufferSize( srcBitmap.width * srcBitmap.rows ); - unsigned char* buffer = new unsigned char[bufferSize]; - memcpy( buffer, srcBitmap.buffer,bufferSize ); - destBitmap = PixelData::New( buffer, bufferSize, srcBitmap.width, srcBitmap.rows, Pixel::L8, PixelData::DELETE_ARRAY ); + const unsigned int bufferSize = srcBitmap.width * srcBitmap.rows; + data.buffer = new unsigned char[bufferSize]; + data.width = srcBitmap.width; + data.height = srcBitmap.rows; + data.format = Pixel::L8; + memcpy( data.buffer, srcBitmap.buffer, bufferSize ); } break; } @@ -1316,12 +1344,14 @@ void FontClient::Plugin::ConvertBitmap( PixelData& destBitmap, #ifdef FREETYPE_BITMAP_SUPPORT case FT_PIXEL_MODE_BGRA: { - if ( srcBitmap.pitch == static_cast< int >( srcBitmap.width << 2 ) ) + if( srcBitmap.pitch == static_cast( srcBitmap.width << 2u ) ) { - unsigned int bufferSize( srcBitmap.width * srcBitmap.rows * 4 ); - unsigned char* buffer = new unsigned char[bufferSize]; - memcpy( buffer, srcBitmap.buffer,bufferSize ); - destBitmap = PixelData::New( buffer, bufferSize, srcBitmap.width, srcBitmap.rows, Pixel::BGRA8888, PixelData::DELETE_ARRAY ); + const unsigned int bufferSize = srcBitmap.width * srcBitmap.rows * 4u; + data.buffer = new unsigned char[bufferSize]; + data.width = srcBitmap.width; + data.height = srcBitmap.rows; + data.format = Pixel::BGRA8888; + memcpy( data.buffer, srcBitmap.buffer, bufferSize ); } break; } diff --git a/text/dali/internal/text-abstraction/font-client-plugin-impl.h b/text/dali/internal/text-abstraction/font-client-plugin-impl.h index aad7d54..fcd7953 100644 --- a/text/dali/internal/text-abstraction/font-client-plugin-impl.h +++ b/text/dali/internal/text-abstraction/font-client-plugin-impl.h @@ -149,42 +149,42 @@ struct FontClient::Plugin ~Plugin(); /** - * @copydoc Dali::FontClient::SetDpi() + * @copydoc Dali::TextAbstraction::FontClient::SetDpi() */ void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi ); /** - * @copydoc Dali::FontClient::ResetSystemDefaults() + * @copydoc Dali::TextAbstraction::FontClient::ResetSystemDefaults() */ void ResetSystemDefaults(); /** - * @copydoc Dali::FontClient::SetDefaultFont() + * @copydoc Dali::TextAbstraction::FontClient::SetDefaultFont() */ void SetDefaultFont( const FontDescription& preferredFontDescription ); /** - * @copydoc Dali::FontClient::GetDefaultPlatformFontDescription() + * @copydoc Dali::TextAbstraction::FontClient::GetDefaultPlatformFontDescription() */ void GetDefaultPlatformFontDescription( FontDescription& fontDescription ); /** - * @copydoc Dali::FontClient::GetDefaultFonts() + * @copydoc Dali::TextAbstraction::FontClient::GetDefaultFonts() */ void GetDefaultFonts( FontList& defaultFonts ); /** - * @copydoc Dali::FontClient::GetSystemFonts() + * @copydoc Dali::TextAbstraction::FontClient::GetSystemFonts() */ void GetSystemFonts( FontList& systemFonts ); /** - * @copydoc Dali::FontClient::GetDescription() + * @copydoc Dali::TextAbstraction::FontClient::GetDescription() */ void GetDescription( FontId id, FontDescription& fontDescription ) const; /** - * @copydoc Dali::FontClient::GetPointSize() + * @copydoc Dali::TextAbstraction::FontClient::GetPointSize() */ PointSize26Dot6 GetPointSize( FontId id ); @@ -204,14 +204,14 @@ struct FontClient::Plugin bool preferColor ); /** - * @copydoc Dali::FontClient::FindDefaultFont() + * @copydoc Dali::TextAbstraction::FontClient::FindDefaultFont() */ FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor ); /** - * @copydoc Dali::FontClient::FindFallbackFont() + * @copydoc Dali::TextAbstraction::FontClient::FindFallbackFont() */ FontId FindFallbackFont( Character charcode, const FontDescription& preferredFontDescription, @@ -219,7 +219,7 @@ struct FontClient::Plugin bool preferColor ); /** - * @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) + * @see Dali::TextAbstraction::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) * * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph. * @param[in] cacheDescription Whether to cache the font description. @@ -231,7 +231,7 @@ struct FontClient::Plugin bool cacheDescription = true ); /** - * @see Dali::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) + * @see Dali::TextAbstraction::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex ) * * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph. */ @@ -241,38 +241,38 @@ struct FontClient::Plugin FaceIndex faceIndex ); /** - * @copydoc Dali::FontClient::IsScalable( const FontPath& path ) + * @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontPath& path ) */ bool IsScalable( const FontPath& path ); /** - * @copydoc Dali::FontClient::IsScalable( const FontDescription& fontDescription ) + * @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontDescription& fontDescription ) */ bool IsScalable( const FontDescription& fontDescription ); /** - * @copydoc Dali::FontClient::GetFixedSizes() + * @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes() */ void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes ); /** - * @copydoc Dali::FontClient::GetFixedSizes() + * @copydoc Dali::TextAbstraction::FontClient::GetFixedSizes() */ void GetFixedSizes( const FontDescription& fontDescription, Dali::Vector< PointSize26Dot6 >& sizes ); /** - * @copydoc Dali::FontClient::GetFontMetrics() + * @copydoc Dali::TextAbstraction::FontClient::GetFontMetrics() */ void GetFontMetrics( FontId fontId, FontMetrics& metrics ); /** - * @copydoc Dali::FontClient::GetGlyphIndex() + * @copydoc Dali::TextAbstraction::FontClient::GetGlyphIndex() */ GlyphIndex GetGlyphIndex( FontId fontId, Character charcode ); /** - * @copydoc Dali::FontClient::GetGlyphMetrics() + * @copydoc Dali::TextAbstraction::FontClient::GetGlyphMetrics() */ bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal ); @@ -287,31 +287,41 @@ struct FontClient::Plugin bool GetVectorMetrics( GlyphInfo* array, uint32_t size, bool horizontal ); /** - * @copydoc Dali::FontClient::CreateBitmap() + * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ) + */ + void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data ); + + /** + * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) */ PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex ); /** - * @copydoc Dali::FontClient::CreateVectorBlob() + * @copydoc Dali::TextAbstraction::FontClient::CreateVectorBlob() */ void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight ); /** - * @copydoc Dali::FontClient::GetEllipsisGlyph() + * @copydoc Dali::TextAbstraction::FontClient::GetEllipsisGlyph() */ const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize ); + /** + * @copydoc Dali::TextAbstraction::FontClient::IsColorGlyph() + */ + bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ); + private: /** - * Caches the fonts present in the platform. + * @brief Caches the fonts present in the platform. * * Calls GetFcFontSet() to retrieve the fonts. */ void InitSystemFonts(); /** - * Gets the FontDescription which matches the given pattern + * @brief Gets the FontDescription which matches the given pattern * @param[in] pattern pattern to match against * @param[out] fontDescription the resultant fontDescription that matched * @return true if match found @@ -374,11 +384,12 @@ private: bool cacheDescription ); /** + * @brief Copy the FreeType bitmap to the given buffer. * - * @param[in] destBitmap - * @param[in] srcBitmap + * @param[out] data The bitmap data. + * @param[in] srcBitmap The FreeType bitmap. */ - void ConvertBitmap( PixelData& destBitmap, FT_Bitmap srcBitmap ); + void ConvertBitmap( TextAbstraction::FontClient::GlyphBufferData& data, FT_Bitmap srcBitmap ); /** * @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index. -- 2.7.4