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 {
00054 class FreeTypeFont : public Font
00055 {
00056 public:
00091 FreeTypeFont(const String& font_name, const float point_size,
00092 const bool anti_aliased, const String& font_filename,
00093 const String& resource_group = "",
00094 const bool auto_scaled = false,
00095 const float native_horz_res = 640.0f,
00096 const float native_vert_res = 480.0f);
00097
00099 ~FreeTypeFont();
00100
00102 float getPointSize() const;
00103
00105 bool isAntiAliased() const;
00106
00108 void setPointSize(const float point_size);
00109
00111 void setAntiAliased(const bool anti_alaised);
00112
00113 protected:
00129 void drawGlyphToBuffer(argb_t* buffer, uint buf_width) const;
00130
00140 uint getTextureSize(CodepointMap::const_iterator s,
00141 CodepointMap::const_iterator e) const;
00142
00144 void addFreeTypeFontProperties();
00146 void free();
00147
00148
00149 void rasterise(utf32 start_codepoint, utf32 end_codepoint) const;
00150 void updateFont();
00151 void writeXMLToStream_impl (XMLSerializer& xml_stream) const;
00152
00154 float d_ptSize;
00156 bool d_antiAliased;
00158 FT_Face d_fontFace;
00160 RawDataContainer d_fontData;
00162 typedef std::vector<Imageset*> ImagesetVector;
00164 mutable ImagesetVector d_glyphImages;
00165 };
00166
00167 }
00168
00169 #endif // end of guard _CEGUIFreeTypeFont_h_