#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.
#include FT_GLYPH_H
#include FT_OUTLINE_H
#include FT_STROKER_H
+#include FT_SYNTHESIS_H
// forward declarations of font config types.
struct _FcCharSet;
*/
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.
{
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.
/**
* @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.
~Plugin();
/**
+ * @copydoc Dali::TextAbstraction::FontClient::ClearCache()
+ */
+ void ClearCache();
+
+ /**
* @copydoc Dali::TextAbstraction::FontClient::SetDpi()
*/
void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi );
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 )
*/
bool IsColorGlyph( FontId fontId, GlyphIndex glyphIndex );
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+ */
+ bool AddCustomFontDirectory( const FontPath& path );
+
+ /**
+ * @copydoc Dali::TextAbstraction::Internal::FontClient::GetFreetypeFace()
+ */
+ FT_FaceRec_* GetFreetypeFace( FontId fontId );
+
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,
*
* @return A character set.
*/
- _FcCharSet* CreateCharacterSetFromDescription( const FontDescription& description ) const;
+ _FcCharSet* CreateCharacterSetFromDescription( const FontDescription& description );
+
+ /**
+ * @brief Destroy all matched Patterns.
+ *
+ */
+ void DestroyMatchedPatterns();
private:
std::vector<FallbackCacheItem> mFallbackCache; ///< Cached fallback font lists.
- std::vector<FontFaceCacheItem> 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<FontDescriptionCacheItem> 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<FontIdCacheItem> 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<FontFaceCacheItem> 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<FontDescriptionCacheItem> 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<FontDescriptionSizeCacheItem> 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<EllipsisItem> mEllipsisCache; ///< Caches ellipsis glyphs for a particular point size.
+ VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc.
+ Vector<EllipsisItem> 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
};