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 int FontClient::GetDefaultFontSize()
80 return GetImplementation(*this).GetDefaultFontSize();
83 void FontClient::ResetSystemDefaults()
85 GetImplementation(*this).ResetSystemDefaults();
88 void FontClient::GetDefaultFonts( FontList& defaultFonts )
90 GetImplementation(*this).GetDefaultFonts( defaultFonts );
93 void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription )
95 GetImplementation(*this).GetDefaultPlatformFontDescription( fontDescription );
98 void FontClient::GetSystemFonts( FontList& systemFonts )
100 GetImplementation(*this).GetSystemFonts( systemFonts );
103 void FontClient::GetDescription( FontId id, FontDescription& fontDescription )
105 GetImplementation(*this).GetDescription( id, fontDescription );
108 PointSize26Dot6 FontClient::GetPointSize( FontId id )
110 return GetImplementation(*this).GetPointSize( id );
113 FontId FontClient::FindDefaultFont( Character charcode,
114 PointSize26Dot6 requestedPointSize,
117 return GetImplementation(*this).FindDefaultFont( charcode,
122 FontId FontClient::FindFallbackFont( Character charcode,
123 const FontDescription& preferredFontDescription,
124 PointSize26Dot6 requestedPointSize,
127 return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
130 FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
132 return GetImplementation(*this).GetFontId( path, requestedPointSize, faceIndex );
135 FontId FontClient::GetFontId( const FontDescription& fontDescription,
136 PointSize26Dot6 requestedPointSize,
137 FaceIndex faceIndex )
139 return GetImplementation(*this).GetFontId( fontDescription,
144 bool FontClient::IsScalable( const FontPath& path )
146 return GetImplementation(*this).IsScalable( path );
149 bool FontClient::IsScalable( const FontDescription& fontDescription )
151 return GetImplementation(*this).IsScalable( fontDescription );
154 void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
156 GetImplementation(*this).GetFixedSizes( path, sizes );
159 void FontClient::GetFixedSizes( const FontDescription& fontDescription,
160 Dali::Vector< PointSize26Dot6 >& sizes )
162 GetImplementation(*this).GetFixedSizes( fontDescription, sizes );
165 void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
167 GetImplementation(*this).GetFontMetrics( fontId, metrics );
170 GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
172 return GetImplementation(*this).GetGlyphIndex( fontId, charcode );
175 bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
177 return GetImplementation(*this).GetGlyphMetrics( array, size, type, horizontal );
180 void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, GlyphBufferData& data )
182 GetImplementation(*this).CreateBitmap( fontId, glyphIndex, data );
185 PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
187 return GetImplementation(*this).CreateBitmap( fontId, glyphIndex );
190 void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
192 GetImplementation(*this).CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
195 const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
197 return GetImplementation(*this).GetEllipsisGlyph( requestedPointSize );
200 bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
202 return GetImplementation(*this).IsColorGlyph( fontId, glyphIndex );
205 FontClient::FontClient( Internal::FontClient* internal )
206 : BaseHandle( internal )
210 } // namespace TextAbstraction