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/public-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::SetDefaultFontFamily()
71 void SetDefaultFontFamily( const std::string& fontFamilyName,
72 const std::string& fontStyle );
75 * @copydoc Dali::FontClient::GetDefaultFonts()
77 void GetDefaultFonts( FontList& defaultFonts );
80 * @copydoc Dali::FontClient::GetSystemFonts()
82 void GetSystemFonts( FontList& systemFonts );
85 * @copydoc Dali::FontClient::GetDescription()
87 void GetDescription( FontId id, FontDescription& fontDescription );
90 * @copydoc Dali::FontClient::GetPointSize()
92 PointSize26Dot6 GetPointSize( FontId id );
95 * @copydoc Dali::FontClient::FindDefaultFont()
97 FontId FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor );
100 * @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex )
102 FontId GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex );
105 * @copydoc Dali::FontClient::GetFontId(const FontFamily& fontFamily, const FontStyle& fontStyle, PointSize26Dot6 pointSize, FaceIndex faceIndex )
107 FontId GetFontId( const FontFamily& fontFamily,
108 const FontStyle& fontStyle,
109 PointSize26Dot6 pointSize,
110 FaceIndex faceIndex );
113 * @copydoc Dali::FontClient::IsScalable(const FontPath& path )
115 bool IsScalable( const FontPath& path );
118 * @copydoc Dali::FontClient::IsScalable( const FontFamily& fontFamily, const FontStyle& fontStyle )
120 bool IsScalable( const FontFamily& fontFamily, const FontStyle& style );
123 * @copydoc Dali::FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
125 void GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes );
128 * @copydoc Dali::FontClient::GetFixedSizes( const FontFamily& fontFamily, const FontStyle& fontStyle, Dali::Vector< PointSize26Dot6>& sizes )
130 void GetFixedSizes( const FontFamily& fontFamily,
131 const FontStyle& style,
132 Dali::Vector< PointSize26Dot6 >& sizes );
135 * @copydoc Dali::FontClient::GetFontMetrics()
137 void GetFontMetrics( FontId fontId, FontMetrics& metrics );
140 * @copydoc Dali::FontClient::GetGlyphIndex()
142 GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
145 * @copydoc Dali::FontClient::CreateMetrics()
147 bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
150 * @copydoc Dali::FontClient::CreateBitmap()
152 BufferImage CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
157 * Helper for lazy initialization.
161 // Undefined copy constructor.
162 FontClient( const FontClient& );
164 // Undefined assignment constructor.
165 FontClient& operator=( FontClient& );
172 // Allows DPI to be set without loading plugin
173 unsigned int mDpiHorizontal;
174 unsigned int mDpiVertical;
176 }; // class FontClient
178 } // namespace Internal
180 inline static Internal::FontClient& GetImplementation(FontClient& fontClient)
182 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
183 BaseObject& handle = fontClient.GetBaseObject();
184 return static_cast<Internal::FontClient&>(handle);
187 inline static const Internal::FontClient& GetImplementation(const FontClient& fontClient)
189 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
190 const BaseObject& handle = fontClient.GetBaseObject();
191 return static_cast<const Internal::FontClient&>(handle);
194 } // namespace TextAbstraction
198 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H__