diff options
Diffstat (limited to 'font.h')
-rw-r--r-- | font.h | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -3,23 +3,25 @@ #include <SDL2/SDL.h> +#define PSF_MAGIC_NUMBER 0x864ab572 + typedef struct { - int code_point; - SDL_Point next_glyph_offset; - SDL_Rect bounds; - char *bitmap; - int bitmap_size; -} BDFFontChar; +} PSFFontHeader; typedef struct { - SDL_Rect bounds; - BDFFontChar *chars; - int num_chars; - int char_index_for_code_point[128]; -} BDFFontInfo; + uint32_t magic; + uint32_t version; + uint32_t header_size; + uint32_t flags; + uint32_t num_glyphs; + uint32_t bytes_per_glyph; + uint32_t height; + uint32_t width; + uint8_t *glyph_data; +} PSFFont; -BDFFontInfo font_load(const char *); -SDL_Texture *font_create_texture(SDL_Renderer *, BDFFontInfo *); -void font_destroy(BDFFontInfo *); +PSFFont font_load(const char *); +SDL_Texture *font_create_texture(SDL_Renderer *, PSFFont *); +void font_destroy(PSFFont *); #endif |