From c2e8836f592db9cf28111182ea40f1268c758933 Mon Sep 17 00:00:00 2001 From: cflip Date: Sun, 8 Jan 2023 21:25:21 -0700 Subject: Connect the window and font code to the editor's main function --- font.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 font.h (limited to 'font.h') diff --git a/font.h b/font.h new file mode 100644 index 0000000..3a19cb1 --- /dev/null +++ b/font.h @@ -0,0 +1,25 @@ +#ifndef _FONT_H +#define _FONT_H + +#include + +typedef struct { + int code_point; + SDL_Point next_glyph_offset; + SDL_Rect bounds; + char *bitmap; + int bitmap_size; +} BDFFontChar; + +typedef struct { + SDL_Rect bounds; + BDFFontChar *chars; + int num_chars; + int char_index_for_code_point[128]; +} BDFFontInfo; + +BDFFontInfo font_load(const char *); +SDL_Texture *font_create_texture(SDL_Renderer *, BDFFontInfo *); +void font_destroy(BDFFontInfo *); + +#endif -- cgit v1.2.3