00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEROSIN_FONTSERVER_H
00023 #define KEROSIN_FONTSERVER_H
00024
00025 #include <zeitgeist/leaf.h>
00026 #include <zeitgeist/class.h>
00027
00028 #include <ft2build.h>
00029 #include FT_FREETYPE_H
00030
00031 namespace kerosin
00032 {
00033
00034 class Font;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class FontServer : public zeitgeist::Leaf
00052 {
00053 public:
00054 FontServer();
00055 ~FontServer();
00056
00058 boost::shared_ptr<Font> GetFont(const std::string &name,
00059 unsigned int size = 12);
00060
00062 boost::shared_ptr<Font> FindFont(const std::string &name,
00063 unsigned int size) const;
00064
00066 void Begin();
00067
00069 void End();
00070
00071 protected:
00072 bool LoadFont(const std::string &name, unsigned int size,
00073 boost::shared_ptr<Font> &font);
00074
00075 private:
00076 typedef std::list<boost::shared_ptr<kerosin::Font> > TFontList;
00077
00079 TFontList mFonts;
00080
00082 FT_Library mFreeTypeLib;
00083 };
00084
00085 DECLARE_CLASS(FontServer);
00086
00087 }
00088
00089 #endif //KEROSIN_FONTSERVER_H
00090