00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUIFreeTypeFont_h_
00031 #define _CEGUIFreeTypeFont_h_
00032
00033 #include "CEGUIFont.h"
00034 #include "CEGUIImage.h"
00035 #include "CEGUIDataContainer.h"
00036
00037 #include <ft2build.h>
00038 #include FT_FREETYPE_H
00039
00040
00041 namespace CEGUI
00042 {
00043
00044
00045 namespace FontProperties
00046 {
00047 class FreeTypePointSize;
00048 class FreeTypeAntialiased;
00049 };
00050
00062 class FreeTypeFont : public Font
00063 {
00064 protected:
00065 friend class FontManager;
00066 friend class FontProperties::FreeTypePointSize;
00067 friend class FontProperties::FreeTypeAntialiased;
00068
00069 typedef std::vector<Imageset*> ImagesetVector;
00071 ImagesetVector d_glyphImages;
00072
00074 float d_ptSize;
00076 bool d_antiAliased;
00077
00079 FT_Face d_fontFace;
00081 RawDataContainer d_fontData;
00082
00098 void drawGlyphToBuffer (argb_t* buffer, uint buf_width);
00099
00109 uint getTextureSize (CodepointMap::const_iterator s,
00110 CodepointMap::const_iterator e);
00111
00113 FreeTypeFont (const String& name, const String& filename,
00114 const String& resourceGroup);
00115
00117 FreeTypeFont (const XMLAttributes& attributes);
00118
00120 virtual ~FreeTypeFont ();
00121
00123 virtual void updateFont ();
00124
00126 virtual void writeXMLToStream_impl (XMLSerializer& xml_stream) const;
00127
00132 void addFreeTypeFontProperties ();
00133
00138 void free ();
00139
00140 public:
00142 virtual void load ();
00143
00145 virtual void rasterize (utf32 start_codepoint, utf32 end_codepoint);
00146 };
00147
00148 }
00149
00150 #endif // end of guard _CEGUIFreeTypeFont_h_