SANDAL2
A SDL2 Wrapper in C
Classes | Macros | Functions | Variables
Font.h File Reference

Information about TTF objects. More...

#include "Window.h"
Include dependency graph for Font.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Font
 Informations about font. More...
 

Macros

#define SANDAL2_SOLID   0
 
#define SANDAL2_SHADED   1
 
#define SANDAL2_BLENDED   2
 
#define SANDAL2_BOLD   TTF_STYLE_BOLD
 
#define SANDAL2_ITALIC   TTF_STYLE_ITALIC
 
#define SANDAL2_UNDERLINE   TTF_STYLE_UNDERLINE
 
#define SANDAL2_STRIKETHROUGH   TTF_STYLE_STRIKETHROUGH
 
#define SANDAL2_NORMAL   TTF_STYLE_NORMAL
 

Functions

FontcreateFont (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 background font as background color for Shaded quality) More...
 
void freeFont (Font *font)
 free the memory of a Font More...
 
int actualizeTextFont (Font *font, int isScripted)
 actualize the text to cript it or uncript it More...
 
int setTextFont (Font *font, const char *text)
 actualize the text of a Font More...
 
int setColorFont (Font *font, int color[4])
 actualize the color of the Font More...
 
int setStyleFont (Font *font, int style)
 set the text's font style More...
 
int getStyleFont (Font *font, int *style)
 

Variables

ListWindow_windows_SANDAL2
 List of the windows WARNING : do not touch it ... trust me. More...
 

Detailed Description

Information about TTF objects.

Author
Baptiste PRUNIER (KLEVH)

Macro Definition Documentation

◆ SANDAL2_BLENDED

#define SANDAL2_BLENDED   2

Type of text's texture rendering (see SDL2's TTF_RendreText_Blended)

◆ SANDAL2_BOLD

#define SANDAL2_BOLD   TTF_STYLE_BOLD

Text font style : bold

◆ SANDAL2_ITALIC

#define SANDAL2_ITALIC   TTF_STYLE_ITALIC

Text font style : italic

◆ SANDAL2_NORMAL

#define SANDAL2_NORMAL   TTF_STYLE_NORMAL

Text font style : normal

◆ SANDAL2_SHADED

#define SANDAL2_SHADED   1

Type of text's texture rendering (see SDL2's TTF_RendreText_Shaded)

◆ SANDAL2_SOLID

#define SANDAL2_SOLID   0

Type of text's texture rendering (see SDL2's TTF_RendreText_Solid)

◆ SANDAL2_STRIKETHROUGH

#define SANDAL2_STRIKETHROUGH   TTF_STYLE_STRIKETHROUGH

Text font style : strikethrough

◆ SANDAL2_UNDERLINE

#define SANDAL2_UNDERLINE   TTF_STYLE_UNDERLINE

Text font style : underline

Function Documentation

◆ actualizeTextFont()

int actualizeTextFont ( Font font,
int  isScripted 
)

actualize the text to cript it or uncript it

Parameters
font: the font to be actualize
isScripted: 0 if the text should be uncripted, 1 for cripted
Returns
1 if there was an error, 0 if not

◆ createFont()

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 background font as background color for Shaded quality)

Parameters
fontPath: path of the font
texte: text of the object
color: color of the text
quality: quality of the texture (SANDAL2_SOLID, SANDAL2_SHADED or SANDAL2_BLENDED)
Returns
NULL if the object was not initialised, if not, the object

◆ freeFont()

void freeFont ( Font font)

free the memory of a Font

Parameters
font: the Font to be freed

◆ getStyleFont()

int getStyleFont ( Font font,
int *  style 
)

get the text's font style

Parameters
font: the text to get the font style
style: where to store the style
Returns
1 if there was an error, 0 if not

◆ setColorFont()

int setColorFont ( Font font,
int  color[4] 
)

actualize the color of the Font

Parameters
font: the font to be actualize
color: new color
Returns
1 if there was an error, 0 if not

◆ setStyleFont()

int setStyleFont ( Font font,
int  style 
)

set the text's font style

Parameters
font: the text to be modified
style: the style to apply
Returns
1 if there was an error, 0 if not

◆ setTextFont()

int setTextFont ( Font font,
const char *  text 
)

actualize the text of a Font

Parameters
font: the font to be actualize
text: the new text
Returns
1 if there was an error, 0 if not

Variable Documentation

◆ _windows_SANDAL2

ListWindow* _windows_SANDAL2

List of the windows WARNING : do not touch it ... trust me.

List of the windows WARNING : do not touch it ... trust me.