diff options
author | cflip <cflip@cflip.net> | 2023-01-08 21:25:21 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-08 21:25:21 -0700 |
commit | c2e8836f592db9cf28111182ea40f1268c758933 (patch) | |
tree | 1dce79a44616787778a0223eb4e4dcfccf7f2e83 /font.h | |
parent | 76010f7b97e6b71db6e123d28c91f997ff56945c (diff) |
Connect the window and font code to the editor's main function
Diffstat (limited to 'font.h')
-rw-r--r-- | font.h | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#ifndef _FONT_H +#define _FONT_H + +#include <SDL2/SDL.h> + +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 |