00001 #ifndef GUI_GL_FONT_HPP
00002 #define GUI_GL_FONT_HPP
00003
00004 #include <utils.hpp>
00005 #include <gui_font.hpp>
00006 #include <vector>
00007
00008 namespace gui {
00009 namespace gl
00010 {
00011 class material;
00012
00013 struct character_info
00014 {
00015 uint uiCodePoint;
00016
00017 float fU1, fV1;
00018 float fU2, fV2;
00019
00020 std::vector<vector2f> lKerningInfo;
00021 };
00022
00024
00028 class font : public gui::font
00029 {
00030 public :
00031
00033
00036 font(const std::string& sFontFile, uint uiSize);
00037
00039 ~font();
00040
00042
00047 std::array<float,4> get_character_uvs(uint uiChar) const;
00048
00050
00053 float get_character_width(uint uiChar) const;
00054
00056
00064 float get_character_kerning(uint uiChar1, uint uiChar2) const;
00065
00067
00069 utils::wptr<gui::material> get_texture() const;
00070
00071 private :
00072
00073 float fTextureWidth_;
00074 float fTextureHeight_;
00075
00076 utils::refptr<gl::material> pTexture_;
00077 std::vector<character_info> lCharacterList_;
00078
00079 bool bKerning_;
00080 };
00081 }
00082 }
00083
00084 #endif