summaryrefslogtreecommitdiff
path: root/src/font.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/font.h')
-rw-r--r--src/font.h26
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_