19 #ifndef FONT_MANAGER_H
20 #define FONT_MANAGER_H
23 #include <SDL2/SDL_opengl.h>
32 #include <common_features/pge_texture.h>
33 #include <common_features/rect.h>
40 void loadFont(QString font_ini);
41 void loadFontMap(QString fontmap_ini);
43 void printText(QString text,
int x,
int y,
float Red=1.f,
float Green=1.f,
float Blue=1.f,
float Alpha=1.f);
45 QString getFontName();
51 int interletter_space;
61 RasChar() {valid=
false;}
71 QHash<QChar, RasChar > fontMap;
72 QRegExp first_line_only;
75 QList<PGE_Texture > textures;
88 static PGE_Size textSize(QString &text,
int fontID,
int max_line_lenght=0,
bool cut=
false);
89 static int getFontID(QString fontName);
91 static GLuint getChar1(QChar _x);
92 static GLuint getChar2(QChar _x);
100 static void printText(QString text,
int x,
int y,
int font=DefaultRaster,
101 float Red=1.0,
float Green=1.0,
float Blue=1.0,
float Alpha=1.0,
int ttf_FontSize=14);
102 static void printTextTTF(QString text,
int x,
int y,
int pointSize, QRgb color=qRgba(255,255,255,255));
108 static void optimizeText(QString &text,
int max_line_lenght,
int *numLines=0,
int *numCols=0);
109 static QString cropText(QString text,
int max_symbols);
112 static void SDL_string_texture_create(QFont &font, QRgb color, QString &text, GLuint *texture,
bool borders=
false);
113 static void SDL_string_texture_create(QFont &font,
PGE_Rect limitRect,
int fontFlags, QRgb color,
114 QString &text, GLuint *texture,
bool borders=
false);
116 static void SDL_string_render2D(GLuint x, GLuint y, GLuint *texture);
117 static GLuint TextToTexture(QString text,
PGE_Rect rectangle,
int alignFlags,
bool borders=
false);
122 static GLuint textTexture;
123 static QHash<QChar, GLuint> fontTable_1;
124 static QHash<QChar, GLuint> fontTable_2;
125 static QHash<QString, int> fonts;
127 static bool double_pixled;
129 static QFont *defaultFont;
132 #endif // FONT_MANAGER_H
Definition: font_manager.h:80
PGE_Size textSize(QString &text, int max_line_lenght=0, bool cut=false)
Definition: font_manager.cpp:219
static RasterFont * rFont
Default raster font.
Definition: font_manager.h:106
static QList< RasterFont > rasterFonts
Complete array of raster fonts.
Definition: font_manager.h:105
Definition: font_manager.h:34