1 #ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H__
2 #define __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/object/base-object.h>
25 #include <dali/devel-api/text-abstraction/font-client.h>
30 namespace TextAbstraction
37 * Implementation of the FontClient
39 class FontClient : public BaseObject
54 * @copydoc Dali::FontClient::Get()
56 static Dali::TextAbstraction::FontClient Get();
59 * @copydoc Dali::FontClient::SetDpi()
61 void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi );
64 * @copydoc Dali::FontClient::GetDpi()
66 void GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi );
69 * @copydoc Dali::FontClient::ResetSystemDefaults()
71 void ResetSystemDefaults();
74 * @copydoc Dali::FontClient::GetDefaultFonts()
76 void GetDefaultFonts( FontList& defaultFonts );
79 * @copydoc Dali::FontClient::GetDefaultPlatformFontDescription()
81 void GetDefaultPlatformFontDescription( FontDescription& fontDescription );
84 * @copydoc Dali::FontClient::GetSystemFonts()
86 void GetSystemFonts( FontList& systemFonts );
89 * @copydoc Dali::FontClient::GetDescription()
91 void GetDescription( FontId id, FontDescription& fontDescription );
94 * @copydoc Dali::FontClient::GetPointSize()
96 PointSize26Dot6 GetPointSize( FontId id );
99 * @copydoc Dali::FontClient::FindDefaultFont()
101 FontId FindDefaultFont( Character charcode,
102 PointSize26Dot6 requestedPointSize,
106 * @copydoc Dali::FontClient::FindFallbackFont()
108 FontId FindFallbackFont( Character charcode,
109 const FontDescription& preferredFontDescription,
110 PointSize26Dot6 requestedPointSize,
114 * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
116 FontId GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex );
119 * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
121 FontId GetFontId( const FontDescription& fontDescription,
122 PointSize26Dot6 requestedPointSize,
123 FaceIndex faceIndex );
126 * @copydoc Dali::FontClient::IsScalable( const FontPath& path )
128 bool IsScalable( const FontPath& path );
131 * @copydoc Dali::FontClient::IsScalable( const FontDescription& fontDescription )
133 bool IsScalable( const FontDescription& fontDescription );
136 * @copydoc Dali::FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
138 void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes );
141 * @copydoc Dali::FontClient::GetFixedSizes()
143 void GetFixedSizes( const FontDescription& fontDescription,
144 Dali::Vector< PointSize26Dot6 >& sizes );
147 * @copydoc Dali::FontClient::GetFontMetrics()
149 void GetFontMetrics( FontId fontId, FontMetrics& metrics );
152 * @copydoc Dali::FontClient::GetGlyphIndex()
154 GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
157 * @copydoc Dali::FontClient::GetGlyphMetrics()
159 bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal );
162 * @copydoc Dali::FontClient::CreateBitmap()
164 PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
167 * @copydoc Dali::FontClient::CreateVectorBlob()
169 void CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight );
172 * @copydoc Dali::FontClient::GetEllipsisGlyph()
174 const GlyphInfo& GetEllipsisGlyph( PointSize26Dot6 requestedPointSize );
179 * Helper for lazy initialization.
183 // Undefined copy constructor.
184 FontClient( const FontClient& );
186 // Undefined assignment constructor.
187 FontClient& operator=( const FontClient& );
194 // Allows DPI to be set without loading plugin
195 unsigned int mDpiHorizontal;
196 unsigned int mDpiVertical;
198 }; // class FontClient
200 } // namespace Internal
202 inline static Internal::FontClient& GetImplementation(FontClient& fontClient)
204 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
205 BaseObject& handle = fontClient.GetBaseObject();
206 return static_cast<Internal::FontClient&>(handle);
209 inline static const Internal::FontClient& GetImplementation(const FontClient& fontClient)
211 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
212 const BaseObject& handle = fontClient.GetBaseObject();
213 return static_cast<const Internal::FontClient&>(handle);
216 } // namespace TextAbstraction
220 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H__