2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/text-abstraction/font-client.h>
22 #include <dali/internal/text-abstraction/font-client-impl.h>
27 namespace TextAbstraction
30 const PointSize26Dot6 FontClient::DEFAULT_POINT_SIZE = 768u; // 12*64
32 FontClient FontClient::Get()
34 return Internal::FontClient::Get();
37 FontClient::FontClient()
41 FontClient::~FontClient()
45 FontClient::FontClient( const FontClient& handle )
46 : BaseHandle( handle )
50 FontClient& FontClient::operator=( const FontClient& handle )
52 BaseHandle::operator=( handle );
56 void FontClient::SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi )
58 GetImplementation(*this).SetDpi( horizontalDpi, verticalDpi );
61 void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi )
63 GetImplementation(*this).GetDpi( horizontalDpi, verticalDpi );
66 void FontClient::ResetSystemDefaults()
68 GetImplementation(*this).ResetSystemDefaults();
71 void FontClient::GetDefaultFonts( FontList& defaultFonts )
73 GetImplementation(*this).GetDefaultFonts( defaultFonts );
76 void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription )
78 GetImplementation(*this).GetDefaultPlatformFontDescription( fontDescription );
81 void FontClient::GetSystemFonts( FontList& systemFonts )
83 GetImplementation(*this).GetSystemFonts( systemFonts );
86 void FontClient::GetDescription( FontId id, FontDescription& fontDescription )
88 GetImplementation(*this).GetDescription( id, fontDescription );
91 PointSize26Dot6 FontClient::GetPointSize( FontId id )
93 return GetImplementation(*this).GetPointSize( id );
96 FontId FontClient::FindDefaultFont( Character charcode,
97 PointSize26Dot6 requestedPointSize,
100 return GetImplementation(*this).FindDefaultFont( charcode,
105 FontId FontClient::FindFallbackFont( Character charcode,
106 const FontDescription& preferredFontDescription,
107 PointSize26Dot6 requestedPointSize,
110 return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
113 FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
115 return GetImplementation(*this).GetFontId( path, requestedPointSize, faceIndex );
118 FontId FontClient::GetFontId( const FontDescription& fontDescription,
119 PointSize26Dot6 requestedPointSize,
120 FaceIndex faceIndex )
122 return GetImplementation(*this).GetFontId( fontDescription,
127 bool FontClient::IsScalable( const FontPath& path )
129 return GetImplementation(*this).IsScalable( path );
132 bool FontClient::IsScalable( const FontDescription& fontDescription )
134 return GetImplementation(*this).IsScalable( fontDescription );
137 void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
139 GetImplementation(*this).GetFixedSizes( path, sizes );
142 void FontClient::GetFixedSizes( const FontDescription& fontDescription,
143 Dali::Vector< PointSize26Dot6 >& sizes )
145 GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
148 void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
150 GetImplementation(*this).GetFontMetrics( fontId, metrics );
153 GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
155 return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
158 bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
160 return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
163 PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
165 return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
168 void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
170 GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
173 const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
175 return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize );
178 FontClient::FontClient( Internal::FontClient* internal )
179 : BaseHandle( internal )
183 } // namespace TextAbstraction