runtime: CMake-ify gx
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
|
||||
#ifndef GXFONT_H
|
||||
#define GXFONT_H
|
||||
|
||||
class gxCanvas;
|
||||
class gxGraphics;
|
||||
|
||||
class gxFont {
|
||||
public:
|
||||
gxFont(gxGraphics* graphics, gxCanvas* canvas, int width, int height, int begin_char, int end_char, int def_char,
|
||||
int* offs, int* widths);
|
||||
~gxFont();
|
||||
|
||||
int charWidth(int c) const;
|
||||
void render(gxCanvas* dest, unsigned color_argb, int x, int y, const std::string& t);
|
||||
|
||||
private:
|
||||
gxGraphics* graphics;
|
||||
gxCanvas * canvas, *t_canvas;
|
||||
int width, height, begin_char, end_char, def_char;
|
||||
int * offs, *widths;
|
||||
|
||||
/***** GX INTERFACE *****/
|
||||
public:
|
||||
enum { FONT_BOLD = 1, FONT_ITALIC = 2, FONT_UNDERLINE = 4 };
|
||||
|
||||
//ACCESSORS
|
||||
int getWidth() const; //width of widest char
|
||||
int getHeight() const; //height of font
|
||||
int getWidth(const std::string& text) const; //width of string
|
||||
bool isPrintable(int chr) const; //printable char?
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user