#define DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H
/*
- * Copyright (c) 2017 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.
// INTERNAL INCLUDES
#include <dali/devel-api/text-abstraction/font-client.h>
+
+struct FT_FaceRec_;
+
namespace Dali
{
static Dali::TextAbstraction::FontClient Get();
/**
+ * @brief This is used to improve application launch performance
+ *
+ * @return A pre-initialized FontClient
+ */
+ static Dali::TextAbstraction::FontClient PreInitialize();
+
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::ClearCache()
+ */
+ void ClearCache();
+
+ /**
* @copydoc Dali::TextAbstraction::FontClient::SetDpi()
*/
void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi );
FaceIndex faceIndex );
/**
+ * @copydoc Dali::TextAbstraction::FontClient::GetFontId( const BitmapFont& bitmapFont )
+ */
+ FontId GetFontId( const BitmapFont& bitmapFont );
+
+ /**
* @copydoc Dali::TextAbstraction::FontClient::IsScalable( const FontPath& path )
*/
bool IsScalable( const FontPath& path );
Dali::Vector< PointSize26Dot6 >& sizes );
/**
+ * @copydoc Dali::TextAbstraction::FontClient::HasItalicStyle()
+ */
+ bool HasItalicStyle( FontId fontId ) const;
+
+ /**
* @copydoc Dali::TextAbstraction::FontClient::GetFontMetrics()
*/
void GetFontMetrics( FontId fontId, FontMetrics& metrics );
bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, 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 isItalicRequired, bool isBoldRequired, 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 isItalicRequired, bool isBoldRequired, 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::CreateEmbeddedItem()
+ */
+ GlyphIndex CreateEmbeddedItem( const TextAbstraction::FontClient::EmbeddedItemDescription& description, Pixel::Format& pixelFormat );
+
+ /**
+ * @brief Retrieves the pointer to the FreeType Font Face for the given @p fontId.
+ *
+ * @param[in] fontId The font id.
+ *
+ * @return The pointer to the FreeType Font Face.
+ */
+ FT_FaceRec_* GetFreetypeFace( FontId fontId );
+
+ /**
+ * @brief Retrieves the type of font.
+ *
+ * @param[in] fontId The font id.
+ *
+ * @return FACE_FONT if the font has been loaded by FreeType, BITMAP_FONT if it's a font that has been loaded from images or INVALID if it's a non valid font.
+ */
+ FontDescription::Type GetFontType( FontId fontId );
+
+ /**
+ * @copydoc Dali::TextAbstraction::FontClient::AddCustomFontDirectory()
+ */
+ bool AddCustomFontDirectory( const FontPath& path );
+
private:
/**
unsigned int mDpiHorizontal;
unsigned int mDpiVertical;
+ static Dali::TextAbstraction::FontClient gPreInitializedFontClient;
+
}; // class FontClient
} // namespace Internal