00001 #ifndef FREE_NEHE_H
00002 #define FREE_NEHE_H
00003
00004
00005 #include <ft2build.h>
00006 #include <freetype/freetype.h>
00007 #include <freetype/ftglyph.h>
00008 #include <freetype/ftoutln.h>
00009 #include <freetype/fttrigon.h>
00010
00011
00012 #include "../constants.h"
00013
00014
00015 #include <vector>
00016 #include <string>
00017 #include <iostream>
00018
00019 using namespace std;
00020
00021
00022
00023 struct freetype_font_data {
00024 int width[128];
00025 float h;
00026 GLuint * textures;
00027 GLuint list_base;
00028
00029
00030
00031 void init(const char * fname, unsigned int h);
00032
00033
00034 void clean();
00035 };
00036
00037
00038
00039
00040 void freetype_print(const freetype_font_data &ft_font, float x, float y, const char *fmt, ...) ;
00041 void freetype_print_simple(const freetype_font_data &ft_font, float x, float y, const char *str) ;
00042 int getTextLength(const freetype_font_data &ft_font, const char *fmt, ...);
00043 int getTextLengthSimple( const freetype_font_data &ft_font, char *text );
00044 inline int getCharWidth( const freetype_font_data &ft_font, char c ) {
00045 return ft_font.width[ (unsigned char)c ];
00046 }
00047
00048
00049 #endif