GLICT/fonts.h

Go to the documentation of this file.
00001 /*
00002     GLICT - Graphics Library Interface Creation Toolkit
00003     Copyright (C) 2006-2007 OBJECT Networks
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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

SourceForge.net Logo
generated with doxygen 1.5.3 on Mon Oct 29 18:09:26 2007