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::GlyphBufferData::GlyphBufferData()
40 FontClient::GlyphBufferData::~GlyphBufferData()
44 FontClient FontClient::Get()
46 return Internal::FontClient::Get();
49 FontClient::FontClient()
53 FontClient::~FontClient()
57 FontClient::FontClient( const FontClient& handle )
58 : BaseHandle( handle )
62 FontClient& FontClient::operator=( const FontClient& handle )
64 BaseHandle::operator=( handle );
68 void FontClient::SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi )
70 GetImplementation(*this).SetDpi( horizontalDpi, verticalDpi );
73 void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi )
75 GetImplementation(*this).GetDpi( horizontalDpi, verticalDpi );
78 void FontClient::ResetSystemDefaults()
80 GetImplementation(*this).ResetSystemDefaults();
83 void FontClient::GetDefaultFonts( FontList& defaultFonts )
85 GetImplementation(*this).GetDefaultFonts( defaultFonts );
88 void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription )
90 GetImplementation(*this).GetDefaultPlatformFontDescription( fontDescription );
93 void FontClient::GetSystemFonts( FontList& systemFonts )
95 GetImplementation(*this).GetSystemFonts( systemFonts );
98 void FontClient::GetDescription( FontId id, FontDescription& fontDescription )
100 GetImplementation(*this).GetDescription( id, fontDescription );
103 PointSize26Dot6 FontClient::GetPointSize( FontId id )
105 return GetImplementation(*this).GetPointSize( id );
108 FontId FontClient::FindDefaultFont( Character charcode,
109 PointSize26Dot6 requestedPointSize,
112 return GetImplementation(*this).FindDefaultFont( charcode,
117 FontId FontClient::FindFallbackFont( Character charcode,
118 const FontDescription& preferredFontDescription,
119 PointSize26Dot6 requestedPointSize,
122 return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
125 FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
127 return GetImplementation(*this).GetFontId( path, requestedPointSize, faceIndex );
130 FontId FontClient::GetFontId( const FontDescription& fontDescription,
131 PointSize26Dot6 requestedPointSize,
132 FaceIndex faceIndex )
134 return GetImplementation(*this).GetFontId( fontDescription,
139 bool FontClient::IsScalable( const FontPath& path )
141 return GetImplementation(*this).IsScalable( path );
144 bool FontClient::IsScalable( const FontDescription& fontDescription )
146 return GetImplementation(*this).IsScalable( fontDescription );
149 void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
151 GetImplementation(*this).GetFixedSizes( path, sizes );
154 void FontClient::GetFixedSizes( const FontDescription& fontDescription,
155 Dali::Vector< PointSize26Dot6 >& sizes )
157 GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
160 void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
162 GetImplementation(*this).GetFontMetrics( fontId, metrics );
165 GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
167 return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
170 bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
172 return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
175 void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data )
177 GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data );
180 PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
182 return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
185 void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
187 GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
190 const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
192 return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize );
195 bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
197 return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
200 FontClient::FontClient( Internal::FontClient* internal )
201 : BaseHandle( internal )
205 } // namespace TextAbstraction