00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef __GLICT_FONTS_H
00028 #define __GLICT_FONTS_H
00029
00030 #include <string>
00031 #include <vector>
00032 typedef bool(*_glictFontRenderFuncBoolNoSize)(const char* text, const void* font, float x, float y) ;
00033 typedef bool(*_glictFontRenderFuncBoolSize)(const char* text, const void* font, float size, float x, float y) ;
00034 typedef void(*_glictFontRenderFuncVoidNoSize)(const char* text, const void* font, float x, float y) ;
00035 typedef void(*_glictFontRenderFuncVoidSize)(const char* text, const void* font, float size, float x, float y) ;
00036
00037
00038 typedef bool(*_glictFontRenderFuncBoolNoSize)(const char* text, const void* font, float x, float y) ;
00039 typedef bool(*_glictFontRenderFuncBoolSize)(const char* text, const void* font, float size, float x, float y) ;
00040 typedef void(*_glictFontRenderFuncVoidNoSize)(const char* text, const void* font, float x, float y) ;
00041 typedef void(*_glictFontRenderFuncVoidSize)(const char* text, const void* font, float size, float x, float y) ;
00042
00043
00044 typedef float(*_glictFontSizeFuncSize)(const char* text, const void* font, float size) ;
00045 typedef float(*_glictFontSizeFuncNoSize)(const char* text, const void* font) ;
00046
00047
00049 class glictFont {
00050 public:
00051 glictFont();
00052 ~glictFont();
00053
00054 void SetName(const char* newname);
00055 std::string GetName();
00056 void SetFontParam(void* font);
00057
00058 void* GetFontParam () {return fontparam;}
00059
00060 void SetRenderFunc(_glictFontRenderFuncBoolNoSize funcpointer);
00061 void SetRenderFunc(_glictFontRenderFuncBoolSize funcpointer);
00062 void SetRenderFunc(_glictFontRenderFuncVoidNoSize funcpointer);
00063 void SetRenderFunc(_glictFontRenderFuncVoidSize funcpointer);
00064
00065 void SetSizeFunc(_glictFontSizeFuncSize funcpointer);
00066 void SetSizeFunc(_glictFontSizeFuncNoSize funcpointer);
00067
00068
00069 void SetRenderFunc();
00070 private:
00071 std::string name;
00072 _glictFontRenderFuncBoolNoSize RenderBoolNoSize;
00073 _glictFontRenderFuncBoolSize RenderBoolSize;
00074 _glictFontRenderFuncVoidNoSize RenderVoidNoSize;
00075 _glictFontRenderFuncVoidSize RenderVoidSize;
00076
00077 _glictFontSizeFuncSize SizeSize;
00078 _glictFontSizeFuncNoSize SizeNoSize;
00079
00080
00081 void* fontparam;
00082
00083 friend bool glictFontRender(const char* text, const char* fontname, float x, float y);
00084 friend bool glictFontRender(const char* text, const char* fontname, float fontsize, float x, float y);
00085
00086 friend float glictFontSize(const char* name, const char* font);
00087 friend float glictFontSize(const char* name, const char* font, float size);
00088
00089 };
00090
00091
00092
00093 typedef std::vector<glictFont*> _GLICTFONTVECTOR;
00094 typedef _GLICTFONTVECTOR::iterator _GLICTFONTVECTORITERATOR;
00095
00096
00097 glictFont* glictCreateFont(const char* name);
00098 glictFont* glictFindFont(const char* name);
00099 bool glictDeleteFont(const char* name);
00100
00101 float glictFontSize(const char* name, const char* font);
00102 float glictFontSize(const char* name, const char* font, float size);
00103
00104 int glictFontNumberOfLines(const char* text);
00105
00106 bool glictFontRender(const char* text, const char* fontname, float x, float y);
00107 bool glictFontRender(const char* text, const char* fontname, float fontsize, float x, float y);
00108
00109 #endif