From 790249cc59bdf646ee38a081ebe392c33ae5b732 Mon Sep 17 00:00:00 2001 From: Menase Teshale Date: Mon, 24 Aug 2026 10:53:14 +0300 Subject: Started working on fonts --- src/font.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/font.h (limited to 'src/font.h') 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 +#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_ -- cgit v1.2.3