#ifndef JNR_FONT_H #define JNR_FONT_H #include /* ═══════════════════════════════════════════════════ * Minimal 4x7 bitmap font * * Each character is 4 pixels wide, 7 pixels tall. * Covers ASCII 32-95 (space through underscore). * Lowercase maps to uppercase automatically. * ═══════════════════════════════════════════════════ */ #define FONT_W 4 #define FONT_H 7 #define FONT_SPACING 1 /* 1px gap between characters */ /* Draw a single character at pixel position (x, y). */ void font_draw_char(SDL_Renderer *r, char ch, int x, int y, SDL_Color col); /* Draw a null-terminated string at pixel position (x, y). */ void font_draw_text(SDL_Renderer *r, const char *text, int x, int y, SDL_Color col); /* Draw text centered horizontally on the given y, within a region of * total_width pixels starting at x=0. */ void font_draw_text_centered(SDL_Renderer *r, const char *text, int y, int total_width, SDL_Color col); /* Return the pixel width of a string (without trailing spacing). */ int font_text_width(const char *text); #endif /* JNR_FONT_H */