summaryrefslogtreecommitdiff
path: root/src/font.h
blob: a26c3325a1ca25feb46fe8daad63a703694307a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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_