#ifndef _TEXT #define _TEXT typedef struct { char* data; int width, height, flags; } Font; // Flags : #define MONOSPACE 0x00000001 #define ANTIALIASING 0x00000002 const static char default_data[] = { 0,0,0,0,0, // ' ' 128,128,128,0,128, // '!' 160,160,0,0,0, // '"' 80,248,80,248,80, // '#' 64,224,64,224,64, // '$' 200,208,32,88,152, // '%' 0,96,64,144,96, // '&' 128,128,0,0,0, // ''' 64,128,128,128,64, // '(' 128,64,64,64,128, // ')' 64,224,64,160,0, // '*' 32,32,248,32,32, // '+' 0,0,0,128,128, // ',' 0,0,248,0,0, // '-' 0,0,0,0,128, // '.' 8,16,32,64,128, // '/' 248,136,136,136,248, // '0' 192,64,64,64,64, // '1' 240,16,240,128,240, // '2' 240,16,112,16,240, // '3' 128,136,136,248,8, // '4' 248,128,248,8,248, // '5' 248,128,248,136,248, // '6' 248,8,8,8,8, // '7' 248,136,248,136,248, // '8' 248,136,248,8,248, // '9' 0,0,128,0,128, // ':' 0,128,0,128,128, // ';' 32,64,128,64,32, // '<' 0,248,0,248,0, // '=' 128,64,32,64,128, // '>' 224,16,96,0,64, // '?' 248,136,184,168,184, // '@' 248,136,248,136,136, // 'A' 240,136,248,136,240, // 'B' 248,128,128,128,248, // 'C' 240,136,136,136,240, // 'D' 248,128,240,128,248, // 'E' 248,128,240,128,128, // 'F' 120,128,184,136,120, // 'G' 136,136,248,136,136, // 'H' 128,128,128,128,128, // 'I' 16,16,16,144,96, // 'J' 136,144,224,144,136, // 'K' 128,128,128,128,248, // 'L' 136,216,168,136,136, // 'M' 248,136,136,136,136, // 'N' 248,136,136,136,248, // 'O' 248,136,248,128,128, // 'P' 112,136,136,152,120, // 'Q' 248,136,248,144,136, // 'R' 248,128,248,8,248, // 'S' 248,32,32,32,32, // 'T' 136,136,136,136,248, // 'U' 136,136,80,80,32, // 'V' 168,168,168,168,248, // 'W' 136,80,32,80,136, // 'X' 136,80,32,32,32, // 'Y' 248,8,112,128,248, // 'Z' 192,128,128,128,192, // '[' 128,64,32,16,8, // '\' 192,64,64,64,192, // ']' 64,160,0,0,0, // '^' 0,0,0,0,248, // '_' 128,64,0,0,0, // '`' 0,112,144,144,112, // 'a' 128,224,144,144,224, // 'b' 0,96,128,128,96, // 'c' 16,112,144,144,112, // 'd' 96,144,240,128,112, // 'e' 48,64,224,64,64, // 'f' 112,144,112,16,224, // 'g' 128,128,224,144,144, // 'h' 128,0,128,128,128, // 'i' 64,0,64,64,128, // 'j' 128,128,160,192,160, // 'k' 128,128,128,128,128, // 'l' 0,0,240,168,168, // 'm' 0,0,224,144,144, // 'n' 0,96,144,144,96, // 'o' 0,240,144,240,128, // 'p' 0,240,144,240,16, // 'q' 0,176,192,128,128, // 'r' 0,112,64,32,224, // 's' 0,128,224,128,96, // 't' 0,0,144,144,96, // 'u' 0,0,136,80,32, // 'v' 0,0,168,168,80, // 'w' 0,0,144,96,144, // 'x' 0,160,224,32,192, // 'y' 0,240,32,64,240, // 'z' 96,64,192,64,96, // '{' 128,128,128,128,128, // '|' 192,64,96,64,192, // '}' 0,0,80,160,0 // '~' }; static Font default_font = {default_data, 5, 5, 0}; // Functions void text_setFont(Font* font); Font* text_getActualFont(); void text_printC(int x, int y, char c, int size, int color); void text_print(int x, int y, char* c, int size, int color); int text_widthC(char c); int text_width(char* c); /* color on 32bits : 16 bits for alpha transparency + 16 bits for color. alpha=0 mean opaque, alpha=32 mean totaly transparent. example : 0x0010FFFF mean "white, 50% opacity" */ #endif //_TEXT