00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __MXFONTZ_H_X_
00017 #define __MXFONTZ_H_X_
00018
00019 #include<string>
00020 #include"mxf.h"
00021 #include"mxsurface.h"
00022 #include"mx_exception.h"
00023 #include"mx_types.h"
00024
00026 namespace mx
00027 {
00028
00030 class mxRegularFont {
00031 public:
00033 mxRegularFont();
00037 mxRegularFont(const mxRegularFont &font);
00038
00043 mxRegularFont &operator=(const mxRegularFont &font);
00044
00048 void setFont(const mxRegularFont &font);
00054 bool loadFont(std::string font_name);
00058 void freeFont();
00059
00064 SDL_Font *getFont() { return font; }
00068 SDL_Font *operator*() { return font; }
00069
00077 void printText(mxSurface &surface, unsigned int x, unsigned int y, unsigned int color, std::string text);
00084 void printText(mxSurface &surface, Point p, Color color, std::string text) {
00085 printText(surface, p.x, p.y, Color::mapRGB(surface, color), text);
00086 }
00096 void printSizedText(mxSurface &surface, unsigned int x, unsigned int y, unsigned int size_w, unsigned int size_h, unsigned int color, std::string text);
00097
00107 int printTextWidth_64(int *depth, mxSurface &surface, int x, int y, int size_width, unsigned int color , const char *src);
00108
00117 int printTextDepth(mxSurface &surface, unsigned int x, unsigned int y, unsigned int color, std::string text);
00118
00119 protected:
00120
00122 struct SDL_Font *font;
00123 };
00124 }
00125
00126
00127
00128 #endif
00129