X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Ftext%2Ftext-abstraction%2Ffont-client-plugin-impl.h;h=9bbc70c797cdbeba3497f204572bbbc19f53b5cb;hb=064bd8be3d1eaa92475030caf03f732da76aaaaa;hp=4f1e344025b0e42840d615651bb9222fb7501383;hpb=70669ad4aea1936c2d3f6a654398d6592f9175af;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/text/text-abstraction/font-client-plugin-impl.h b/dali/internal/text/text-abstraction/font-client-plugin-impl.h index 4f1e344..9bbc70c 100644 --- a/dali/internal/text/text-abstraction/font-client-plugin-impl.h +++ b/dali/internal/text/text-abstraction/font-client-plugin-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_IMPL_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -35,6 +35,7 @@ class VectorFontCache; #include FT_GLYPH_H #include FT_OUTLINE_H #include FT_STROKER_H +#include FT_SYNTHESIS_H // forward declarations of font config types. struct _FcCharSet; @@ -66,7 +67,7 @@ struct FontClient::Plugin */ struct FallbackCacheItem { - FallbackCacheItem( const FontDescription& fontDescription, FontList* fallbackFonts, CharacterSetList* characterSets ); + FallbackCacheItem( FontDescription&& fontDescription, FontList* fallbackFonts, CharacterSetList* characterSets ); FontDescription fontDescription; ///< The font description. FontList* fallbackFonts; ///< The list of fallback fonts for the given font-description. @@ -80,6 +81,8 @@ struct FontClient::Plugin { FontDescriptionCacheItem( const FontDescription& fontDescription, FontDescriptionId index ); + FontDescriptionCacheItem( FontDescription&& fontDescription, + FontDescriptionId index ); FontDescription fontDescription; ///< The font description. FontDescriptionId index; ///< Index to the vector of font descriptions. @@ -88,11 +91,11 @@ struct FontClient::Plugin /** * @brief Caches the font id of the pair font point size and the index to the vector of font descriptions of validated fonts. */ - struct FontIdCacheItem + struct FontDescriptionSizeCacheItem { - FontIdCacheItem( FontDescriptionId validatedFontId, - PointSize26Dot6 requestedPointSize, - FontId fontId ); + FontDescriptionSizeCacheItem( FontDescriptionId validatedFontId, + PointSize26Dot6 requestedPointSize, + FontId fontId ); FontDescriptionId validatedFontId; ///< Index to the vector with font descriptions. PointSize26Dot6 requestedPointSize; ///< The font point size. @@ -297,9 +300,9 @@ struct FontClient::Plugin bool GetVectorMetrics( GlyphInfo* array, uint32_t size, bool horizontal ); /** - * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ) + * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, bool softwareItalic, bool softwareBold, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ) */ - void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ); + void CreateBitmap( FontId fontId, GlyphIndex glyphIndex, bool softwareItalic, bool softwareBold, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ); /** * @copydoc Dali::TextAbstraction::FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth ) @@ -322,6 +325,11 @@ struct FontClient::Plugin bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex ); /** + * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFreetypeFace() + */ + FT_FaceRec_* GetFreetypeFace( FontId fontId ); + + /** * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory() */ bool AddCustomFontDirectory( const FontPath& path ); @@ -434,8 +442,8 @@ private: * @brief Finds a fallback font list from the cache for a given font-description * * @param[in] fontDescription The font to validate. - * @param[out] A valid pointer to a font list, or NULL if not found. - * @param[out] characterSetList A valid pointer to a character set list, or NULL if not found. + * @param[out] A valid pointer to a font list, or @e nullptr if not found. + * @param[out] characterSetList A valid pointer to a character set list, or @e nullptr if not found. */ bool FindFallbackFontList( const FontDescription& fontDescription, FontList*& fontList, @@ -490,7 +498,13 @@ private: * * @return A character set. */ - _FcCharSet* CreateCharacterSetFromDescription( const FontDescription& description ) const; + _FcCharSet* CreateCharacterSetFromDescription( const FontDescription& description ); + + /** + * @brief Destroy all matched Patterns. + * + */ + void DestroyMatchedPatterns(); private: @@ -514,15 +528,15 @@ private: std::vector mFallbackCache; ///< Cached fallback font lists. - std::vector mFontCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'. - std::vector mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font. - FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font. - CharacterSetList mCharacterSetCache; ///< Caches character set lists for the validated font. - std::vector mFontIdCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts. - - VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc. + std::vector mFontFaceCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'. + std::vector mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font. + FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font. + CharacterSetList mCharacterSetCache; ///< Caches character set lists for the validated font. + std::vector mFontDescriptionSizeCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts. - Vector mEllipsisCache; ///< Caches ellipsis glyphs for a particular point size. + VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc. + Vector mEllipsisCache; ///< Caches ellipsis glyphs for a particular point size. + Vector<_FcPattern*> mMatchedFcPatternCache; ///< Contain matched FcPattern pointer. bool mDefaultFontDescriptionCached : 1; ///< Whether the default font is cached or not };