25 #ifndef __GFX_FONT_H__
26 #define __GFX_FONT_H__
28 #include <SDL2/SDL_ttf.h>
48 #ifndef DEFAULT_FONT_SIZE
49 #define DEFAULT_FONT_SIZE 15
56 #define DEFAULT_FONT "IBMPlexSans-Medium.ttf"
62 #ifndef FONTS_DIRECTORY
63 #ifdef RESOURCES_DIRECTORY
64 #define FONTS_DIRECTORY "/" RESOURCES_DIRECTORY "/fonts/"
66 #define FONTS_DIRECTORY "/../resources/fonts/"
70 #define FONTS_DIR "/" FONTS_DIRECTORY "/"
75 #define MAX_FONT_NAME_LENGTH 256
Config file for the FreeRTOS Emulator.
void gfxFontPutFontHandle(font_handle_t font)
Finds the gfx_font object associated with the loaded SDL2 TFF font, decreasing the reference count to...
Definition: gfx_font.c:149
char * gfxFontGetCurFontName(void)
Retrieved the string name of the currently active font.
Definition: gfx_font.c:229
font_handle_t gfxFontGetCurFontHandle(void)
Retrieved a handle to the current font, unlike gfxFontGetCurFont() the handle contains the gfx_Font's...
Definition: gfx_font.c:237
void gfxFontPutFont(const TTF_Font *font)
Finds the gfx_font object associated with the loaded SDL2 TFF font, decreasing the reference count to...
Definition: gfx_font.c:178
int gfxFontLoadFont(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: gfx_font.c:261
TTF_Font * gfxFontGetCurFont(void)
Retrieved a reference to the current SDL2 TTF font, increasing the reference count of the respective ...
Definition: gfx_font.c:207
int gfxFontSelectFontFromName(char *font_name)
Sets the active font from a string of the font's filename. The filename is not the absolute file but ...
Definition: gfx_font.c:277
int gfxFontSetSize(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: gfx_font.c:312
ssize_t gfxFontGetCurFontSize(void)
Returns the size of the currently active font.
Definition: gfx_font.c:221
int gfxFontSelectFontFromHandle(font_handle_t font_handle)
Sets the active font based off of a font handle.
Definition: gfx_font.c:295
void gfxFontExit(void)
Exits the font backend.
Definition: gfx_font.c:133
void * font_handle_t
Handle used to reference a specific font/size configuration when restoring a font using gfxFontSelect...
Definition: gfx_font.h:82
int gfxFontInit(char *path)
Initializes the font backend, the executing binary path is required, this is usually already passed t...
Definition: gfx_font.c:111