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:
00096 FreeTypeFont(const String& font_name, const float point_size,
00097 const bool anti_aliased, const String& font_filename,
00098 const String& resource_group = "",
00099 const bool auto_scaled = false,
00100 const float native_horz_res = 640.0f,
00101 const float native_vert_res = 480.0f,
00102 const float specific_line_spacing = 0.0f);
00103
00105 ~FreeTypeFont();
00106
00108 float getPointSize() const;
00109
00111 bool isAntiAliased() const;
00112
00114 void setPointSize(const float point_size);
00115
00117 void setAntiAliased(const bool anti_alaised);
00118
00119 protected:
00135 void drawGlyphToBuffer(argb_t* buffer, uint buf_width) const;
00136
00146 uint getTextureSize(CodepointMap::const_iterator s,
00147 CodepointMap::const_iterator e) const;
00148
00150 void addFreeTypeFontProperties();
00152 void free();
00153
00154
00155 void rasterise(utf32 start_codepoint, utf32 end_codepoint) const;
00156 void updateFont();
00157 void writeXMLToStream_impl (XMLSerializer& xml_stream) const;
00158
00160 float d_specificLineSpacing;
00162 float d_ptSize;
00164 bool d_antiAliased;
00166 FT_Face d_fontFace;
00168 RawDataContainer d_fontData;
00170 typedef std::vector<Imageset*> ImagesetVector;
00172 mutable ImagesetVector d_glyphImages;
00173 };
00174
00175 }
00176
00177 #endif // end of guard _CEGUIFreeTypeFont_h_