LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
Loading...
Searching...
No Matches
lg_fonts.h
1/*
2 * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2026
3 * All rights reserved
4 */
5
6#ifndef LG_FONTS_H
7#define LG_FONTS_H
8
9#define N_FONTS_MAX 256
10
11#define UD_FONTNAME_MAX_LEN (128 - 1) /* UD = user-defined, used in lg_wins.h for LG_Win_Style */
12
13typedef struct {
14 LG_String *name;
15 LG_String *relative_path; /* Path inside the fonts folder, not relative if symlink */
16 int size;
17 TTF_Font *f;
18} LG_Font;
19
20/* Font description */
21typedef struct {
22 const char *name;
23 const char *relative_path; /* Path inside the fonts folder, not relative if symlink */
24 int size;
26
28
30
31zboolean lg_font_add_to_list(const char *, const char *, int);
32
33LG_Font *lg_font_get(const char *);
34
35TTF_Font *lg_font_get_ttf(const char *);
36
37TTF_Font *lg_font_get_ttf_fallback(const char *);
38
39void lg_font_free(const char *);
40
41void lg_font_free_all();
42
43void lg_font_list_all();
44
45void lg_font_info(LG_Font *);
46
47zboolean lg_font_load_array(LG_Font_Des [], int);
48
50
51#endif /* LG_FONTS_H */
zboolean lg_fonts_list_is_initialized()
Definition lg_fonts.c:43
void lg_font_info(LG_Font *font)
Definition lg_fonts.c:282
void lg_font_free(const char *name)
Definition lg_fonts.c:217
void lg_font_free_all()
Definition lg_fonts.c:242
LG_Font * lg_font_get(const char *name)
Definition lg_fonts.c:126
void lg_fonts_list_init()
Definition lg_fonts.c:29
zboolean lg_font_load_array(LG_Font_Des fonts[], int n_fonts)
Definition lg_fonts.c:311
TTF_Font * lg_font_get_ttf(const char *name)
Definition lg_fonts.c:156
void lg_font_list_all()
Definition lg_fonts.c:265
zboolean lg_font_add_to_list(const char *name, const char *relative_path, int size)
Definition lg_fonts.c:75
TTF_Font * lg_font_get_ttf_fallback(const char *name)
Definition lg_fonts.c:176
void lg_font_list_array(LG_Font_Des fonts[], int n_fonts)
Definition lg_fonts.c:336
Definition lg_fonts.h:21
Definition lg_fonts.h:13
Definition lg_string.h:17