2021-04-24 10:21:34 +02:00
|
|
|
#ifndef FONT_DESC_H
|
|
|
|
#define FONT_DESC_H
|
|
|
|
|
|
|
|
typedef struct RenFont RenFont;
|
|
|
|
|
2021-04-26 15:56:18 +02:00
|
|
|
struct FontInstance {
|
2021-04-24 10:21:34 +02:00
|
|
|
RenFont *font;
|
|
|
|
short int scale;
|
|
|
|
};
|
2021-04-26 15:56:18 +02:00
|
|
|
typedef struct FontInstance FontInstance;
|
2021-04-24 10:21:34 +02:00
|
|
|
|
2021-04-26 15:56:18 +02:00
|
|
|
#define FONT_CACHE_ARRAY_MAX 2
|
2021-04-24 10:21:34 +02:00
|
|
|
|
|
|
|
struct FontDesc {
|
|
|
|
float size;
|
|
|
|
unsigned int options;
|
|
|
|
short int tab_size;
|
2021-04-26 15:56:18 +02:00
|
|
|
FontInstance cache[FONT_CACHE_ARRAY_MAX];
|
|
|
|
short int cache_length;
|
|
|
|
short int cache_last_index; /* More recently used instance. */
|
|
|
|
char filename[0];
|
2021-04-24 10:21:34 +02:00
|
|
|
};
|
|
|
|
typedef struct FontDesc FontDesc;
|
|
|
|
|
2021-04-26 15:56:18 +02:00
|
|
|
void font_desc_init(FontDesc *font_desc, const char *filename, float size, unsigned int font_options);
|
|
|
|
int font_desc_alloc_size(const char *filename);
|
2021-04-24 10:21:34 +02:00
|
|
|
int font_desc_get_tab_size(FontDesc *font_desc);
|
|
|
|
void font_desc_set_tab_size(FontDesc *font_desc, int tab_size);
|
|
|
|
void font_desc_free(FontDesc *font_desc);
|
|
|
|
RenFont *font_desc_get_font_at_scale(FontDesc *font_desc, int scale);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|