SANDAL2
A SDL2 Wrapper in C
Font.h
Go to the documentation of this file.
1 #ifndef FONT_SANDAL2_KLEVH
2 #define FONT_SANDAL2_KLEVH
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include "Window.h"
9 
16 #define SANDAL2_SOLID 0
17 
18 #define SANDAL2_SHADED 1
19 
20 #define SANDAL2_BLENDED 2
21 
23 #define SANDAL2_BOLD TTF_STYLE_BOLD
24 
25 #define SANDAL2_ITALIC TTF_STYLE_ITALIC
26 
27 #define SANDAL2_UNDERLINE TTF_STYLE_UNDERLINE
28 
29 #define SANDAL2_STRIKETHROUGH TTF_STYLE_STRIKETHROUGH
30 
31 #define SANDAL2_NORMAL TTF_STYLE_NORMAL
32 
39 
44 typedef struct{
45  TTF_Font *font;
47  int quality;
49  char *text;
51  SDL_Color color;
53  SDL_Texture *texture;
55 }Font;
56 
57 /* -------------------------------------------------------
58  * Text
59  */
68 Font* createFont(const char *fontPath,const char * texte,int color[4], int quality);
73 void freeFont(Font *font);
80 int actualizeTextFont(Font *font,int isScripted);
87 int setTextFont(Font *font,const char *text);
94 int setColorFont(Font *font,int color[4]);
101 int setStyleFont(Font *font,int style);
108 int getStyleFont(Font *font,int * style);
109 /* ------------------------------------------------------- */
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif
int setStyleFont(Font *font, int style)
set the text's font style
Definition: Font.c:258
TTF_Font * font
Definition: Font.h:45
int getStyleFont(Font *font, int *style)
Definition: Font.c:303
void freeFont(Font *font)
free the memory of a Font
Definition: Font.c:74
SDL_Color color
Definition: Font.h:51
ListWindow * _windows_SANDAL2
List of the windows WARNING : do not touch it ... trust me.
Definition: Window.c:3
Informations about font.
Definition: Font.h:44
int setColorFont(Font *font, int color[4])
actualize the color of the Font
Definition: Font.c:211
int quality
Definition: Font.h:47
int actualizeTextFont(Font *font, int isScripted)
actualize the text to cript it or uncript it
Definition: Font.c:89
Font * createFont(const char *fontPath, const char *texte, int color[4], int quality)
generate a Font using the path to the font, the text and the color of the text (use the window's back...
Definition: Font.c:6
int setTextFont(Font *font, const char *text)
actualize the text of a Font
Definition: Font.c:165
char * text
Definition: Font.h:49
SDL_Texture * texture
Definition: Font.h:53
Contains all structures related to windows but only those unrelated to Elements.
list of windows
Definition: Window.h:128