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 Dali::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::GetSystemFonts()
66 void GetSystemFonts( FontList& systemFonts );
69 * @copydoc Dali::FontClient::FindSystemFont()
71 bool FindSystemFont( Character charcode, FontDescription& systemFont );
74 * @copydoc Dali::FontClient::GetFontId()
76 FontId GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex );
79 * @copydoc Dali::FontClient::FindDefaultFont()
81 FontId FindDefaultFont( Character charcode );
84 * @copydoc Dali::FontClient::GetGlyphIndex()
86 GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
89 * @copydoc Dali::FontClient::CreateMetrics()
91 bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
94 * @copydoc Dali::FontClient::CreateBitmap()
96 BitmapImage CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
101 * Helper for lazy initialization.
105 // Undefined copy constructor.
106 FontClient( const FontClient& );
108 // Undefined assignment constructor.
109 FontClient& operator=( FontClient& );
116 // Allows DPI to be set without loading plugin
117 unsigned int mDpiHorizontal;
118 unsigned int mDpiVertical;
120 }; // class FontClient
122 } // namespace Internal
124 inline static Internal::FontClient& GetImplementation(FontClient& fontClient)
126 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
127 BaseObject& handle = fontClient.GetBaseObject();
128 return static_cast<Internal::FontClient&>(handle);
131 inline static const Internal::FontClient& GetImplementation(const FontClient& fontClient)
133 DALI_ASSERT_ALWAYS( fontClient && "fontClient handle is empty" );
134 const BaseObject& handle = fontClient.GetBaseObject();
135 return static_cast<const Internal::FontClient&>(handle);
138 } // namespace TextAbstraction
142 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_IMPL_H__