2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FGrp_FontFt2.h
20 * @brief This is the header file for FGrp_FontFt2 class.
24 #ifndef _FGRP_INTERNAL_FONT_FT2_H_
25 #define _FGRP_INTERNAL_FONT_FT2_H_
27 #include "FGrp_IFont.h"
30 namespace Tizen { namespace Graphics
42 virtual bool SetAttrib(const Attrib& fontAttrib);
43 virtual bool GetAttrib(Attrib& fontAttrib) const;
45 virtual bool GetKerning(unsigned long character1, unsigned long character2, long& xVector, long& yVector) const;
47 virtual bool LoadGlyph(unsigned long character, Glyph** ppFontGlyphData);
48 virtual bool UnloadGlyph(Glyph** ppFontGlyphData);
49 virtual unsigned long CheckGlyph(unsigned long character);
51 virtual bool GetFontProperty(Property& property) const;
53 virtual bool GetGlyphList(const _Util::String& text, Tizen::Base::Collection::IListT<_IFont::Glyph *>& out, bool isRtl, int script) const;
55 virtual Tizen::Base::Collection::HashMapT<Tizen::Base::String, _IFont::SharedFontResource>* GetFallbackMap(void);
58 virtual bool Create(const void* pBuffer, long bufSize, long face = 0);
59 virtual bool Create(const char* pFilePath, long face = 0);
60 virtual bool CreateStatic(const void* pBuffer, long bufSize, long face = 0);
61 virtual bool Reload(const void* pBuffer, long bufSize, long face = 0);
62 virtual bool Reload(const char* filePath, long face = 0);
63 virtual void Destroy(void);
64 virtual bool FindCache(unsigned long character, int size, int style, Glyph** pOut);
65 virtual bool AddCache(unsigned long character, int size, int style, Glyph* pGlyph);
66 virtual bool CleanCache(void);
69 _FontFt2(const _FontFt2& font);
70 _FontFt2& operator =(const _FontFt2& rhs);
75 // return internal index for wide character
76 unsigned long __GetCharIndex(unsigned long character) const;
78 // convert the glyph of FreeType2 to _IFont::Glyph information
79 bool __ConvertPrivateToImage(void* pData1, _IFont::Glyph** ppFontGlyphData);
81 // set translate matrix
82 bool __SetTransMatrix(void* pMatrix);
87 _IFont::Attrib __fontAttrib;
91 bool __isStaticBuffer;
93 //_FontCache fontCache;
94 std::auto_ptr<_FontCache> __fontCache;
95 // fallback font resources
96 Tizen::Base::Collection::HashMapT<Tizen::Base::String, _IFont::SharedFontResource> __fallbackFontMap;
100 }} // Tizen::Graphics
102 #endif // _FGRP_INTERNAL_FONT_FT2_H_