diff options
| author | Menase Teshale <osome3717@gmail.com> | 2026-08-24 10:53:14 +0300 |
|---|---|---|
| committer | Menase Teshale <osome3717@gmail.com> | 2026-08-24 10:53:14 +0300 |
| commit | 790249cc59bdf646ee38a081ebe392c33ae5b732 (patch) | |
| tree | 45ca1026b88e4d0dc7709d041cb15455ccea508d /src/font.h | |
| parent | 15b194df64db5850757d195344e682bb8ec4c138 (diff) | |
Started working on fonts
Diffstat (limited to 'src/font.h')
| -rw-r--r-- | src/font.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..a26c332 --- /dev/null +++ b/src/font.h @@ -0,0 +1,26 @@ +#ifndef FONT_H_ +#define FONT_H_ + +#include <SDL3/SDL.h> +#define FONT_NAME_SIZE 40 +#define PARSER_LINE_SIZE 4096 + +typedef struct { + float x, y; + float width, height; + float x_offset, y_offset; + float x_advance; + char character; +} font_char; + +typedef struct { + char name[FONT_NAME_SIZE]; + SDL_Texture* spritesheet; + char smallest_character, largest_character; + font_char* characters; +} sprite_font; + +bool load_sprite_font(const char* filename, sprite_font* font); +void free_sprite_font(sprite_font* font); + +#endif // FONT_H_ |
