00001 #if !defined( __ARSFONTENGINE_H__ ) 00002 #define __ARSFONTENGINE_H__ 00003 00004 #include <ft2build.h> 00005 #include FT_FREETYPE_H 00006 #include FT_GLYPH_H 00007 00008 namespace Ars 00009 { 00013 00014 class FontEngine { 00015 private: 00016 00017 unsigned int fontSize; 00018 std::string fontFilename; 00019 00020 public: 00026 FontEngine(const std::string& sFontFileName, unsigned char FontSize); 00027 00029 virtual ~FontEngine(void); 00030 00031 const int GetFontSize( void ) const { return fontSize; } 00032 std::string GetFontFilename( void ) const { return fontFilename; } 00033 00037 FT_BitmapGlyphRec *RenderGlyph( const char Char ); 00038 00042 FT_Glyph_Metrics *GetMetrics( const char Char ); 00043 00044 protected: 00045 static FT_Library m_FTLibrary; 00046 static bool m_bFTLibraryLoaded; 00047 FT_Face m_FontFace; 00048 std::map<char, FT_BitmapGlyphRec> m_CachedGlyphMap; 00049 std::map<char, FT_Glyph_Metrics> m_CachedMetricsMap; 00050 }; 00051 00052 } 00053 00054 #endif