Go to the documentation of this file.
25 #ifndef __TUM_FONT_H__
26 #define __TUM_FONT_H__
28 #include <SDL2/SDL_ttf.h>
49 #ifndef DEFAULT_FONT_SIZE
50 #define DEFAULT_FONT_SIZE 15
51 #endif //DEFAULT_FONT_SIZE
57 #define DEFAULT_FONT "IBMPlexSans-Medium.ttf"
63 #ifndef FONTS_DIRECTORY
64 #ifdef RESOURCES_DIRECTORY
65 #define FONTS_DIRECTORY "/" RESOURCES_DIRECTORY "/fonts/"
67 #define FONTS_DIRECTORY "/../resources/fonts/"
68 #endif //RESOURCES_DIRECTORY
69 #endif // FONTS_DIRECTORY
71 #define FONTS_DIR "/" FONTS_DIRECTORY "/"
76 #define MAX_FONT_NAME_LENGTH 256
201 #endif // __TUM_FONT_H__
int tumFontInit(char *path)
Initializes the font backend, the executing binary path is required, this is usually already passed t...
Definition: TUM_Font.c:111
char * tumFontGetCurFontName(void)
Retrieved the string name of the currently active font.
Definition: TUM_Font.c:229
font_handle_t tumFontGetCurFontHandle(void)
Retrieved a handle to the current font, unlike tumFontGetCurFont() the handle contains the TUM_Font's...
Definition: TUM_Font.c:237
void tumFontPutFontHandle(font_handle_t font)
Finds the tum_font object associated with the loaded SDL2 TFF font, decreasing the reference count to...
Definition: TUM_Font.c:148
void tumFontExit(void)
Exits the font backend.
Definition: TUM_Font.c:132
ssize_t tumFontGetCurFontSize(void)
Returns the size of the currently active font.
Definition: TUM_Font.c:221
int tumFontSetSize(ssize_t font_size)
Sets the size of the current font to be used. The font is set by making a copy of the current font if...
Definition: TUM_Font.c:312
TTF_Font * tumFontGetCurFont(void)
Retrieved a reference to the current SDL2 TTF font, increasing the reference count of the respective ...
Definition: TUM_Font.c:207
void tumFontPutFont(TTF_Font *font)
Finds the tum_font object associated with the loaded SDL2 TFF font, decreasing the reference count to...
Definition: TUM_Font.c:178
void * font_handle_t
Handle used to reference a specific font/size configuration when restoring a font using tumFontSelect...
Definition: TUM_Font.h:83
int tumFontSelectFontFromHandle(font_handle_t font_handle)
Sets the active font based off of a font handle.
Definition: TUM_Font.c:295
int tumFontSelectFontFromName(char *font_name)
Sets the active font from a string of the font's filename. The filename is not the absolute file but ...
Definition: TUM_Font.c:277
int tumFontLoadFont(char *font_name, ssize_t size)
Loads a font with the given font name from the FONTS_DIRECTORY directory, by default this is in resou...
Definition: TUM_Font.c:261
File containing some configuration for the FreeRTOS Emulator.