1 #ifndef __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_IMPL_H__
2 #define __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_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/text-abstraction/font-metrics.h>
23 #include <dali/internal/text-abstraction/font-client-impl.h>
27 #include FT_FREETYPE_H
29 #include <fontconfig/fontconfig.h>
34 namespace TextAbstraction
40 struct FontClient::Plugin
44 CacheItem( FontId id, FT_Face ftFace, const std::string& path, PointSize26Dot6 pointSize, FaceIndex face, const FontMetrics& metrics );
46 FT_Face mFreeTypeFace;
48 PointSize26Dot6 mPointSize;
53 Plugin( unsigned int horizontalDpi, unsigned int verticalDpi );
59 void SetDpi( unsigned int horizontalDpi, unsigned int verticalDpi );
61 void GetSystemFonts( FontList& systemFonts );
63 void InitSystemFonts();
65 _FcFontSet* GetFcFontSet() const;
67 bool GetFcString( const FcPattern* pattern, const char* n, std::string& string );
69 void GetDescription( FontId id, FontDescription& fontDescription ) const;
71 PointSize26Dot6 GetPointSize( FontId id );
73 FontId FindDefaultFont( Character charcode, PointSize26Dot6 pointSize );
75 FontId GetFontId( const std::string& path, PointSize26Dot6 pointSize, FaceIndex faceIndex );
77 FontId GetFontId( const FontFamily& fontFamily,
78 const FontStyle& fontStyle,
79 PointSize26Dot6 pointSize,
80 FaceIndex faceIndex );
82 GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
84 FontId CreateFont( const std::string& path, PointSize26Dot6 pointSize, FaceIndex faceIndex );
86 void GetFontMetrics( FontId fontId, FontMetrics& metrics );
88 bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal );
90 BitmapImage CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
92 void ConvertBitmap( BitmapImage& destBitmap, FT_Bitmap srcBitmap );
96 bool FindFont( const std::string& path, PointSize26Dot6 pointSize, FaceIndex faceIndex, FontId& found ) const;
98 FT_Library mFreeTypeLibrary;
100 FontList mSystemFonts;
102 std::vector<CacheItem> mFontCache;
104 unsigned int mDpiHorizontal;
105 unsigned int mDpiVertical;
108 } // namespace Internal
110 } // namespace TextAbstraction
114 #endif // __DALI_INTERNAL_TEXT_ABSTRACTION_FONT_CLIENT_PLUGIN_IMPL_H__