2023-11-28 00:39:00 +00:00
|
|
|
#ifndef _SMEARGLE_FONT_H
|
|
|
|
#define _SMEARGLE_FONT_H
|
2023-11-27 21:38:00 +00:00
|
|
|
|
|
|
|
typedef struct map_t {
|
2023-11-27 23:33:40 +00:00
|
|
|
const char *glyph;
|
|
|
|
unsigned int index;
|
2023-11-27 21:38:00 +00:00
|
|
|
unsigned int width;
|
|
|
|
struct map_t *next;
|
|
|
|
} map_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *name;
|
2023-11-28 00:31:48 +00:00
|
|
|
char *image_filename;
|
2023-11-27 21:38:00 +00:00
|
|
|
unsigned char bits_per_pixel;
|
|
|
|
unsigned int width;
|
|
|
|
unsigned int height;
|
|
|
|
unsigned int map_entries;
|
|
|
|
map_t *map;
|
|
|
|
} font_t;
|
2023-11-27 23:21:09 +00:00
|
|
|
|
2023-11-28 08:25:03 +00:00
|
|
|
extern void *fontdb;
|
|
|
|
|
|
|
|
font_t *load_fonts(toml_table_t *table, const char *base_path);
|
|
|
|
font_t *font_find(const char *key);
|
|
|
|
font_t font_create(const char *name, const char *filename);
|
2023-11-27 23:21:09 +00:00
|
|
|
void font_destroy(font_t font);
|
|
|
|
unsigned int map_create(toml_table_t *table, map_t **map);
|
|
|
|
void map_destroy(map_t *map);
|
2023-11-28 00:39:00 +00:00
|
|
|
|
|
|
|
#endif
|