// 5x7 ASCII bitmap font for HUD text. Only the printable subset // $20..$5F is encoded; lower-case letters fall back to upper-case. #ifndef FONT_H #define FONT_H #include #include "framebuffer.h" #include "palette.h" #define FONT_WIDTH 5 #define FONT_HEIGHT 7 // Draw a single character at (x, y). Top-left of glyph at (x, y). // Returns the X advance (FONT_WIDTH + 1). int16_t fontDrawChar(FramebufferT *fb, int16_t x, int16_t y, char ch, ColorE color); // Draw a NUL-terminated string. Returns the X advance. int16_t fontDrawString(FramebufferT *fb, int16_t x, int16_t y, const char *s, ColorE color); // Draw `s` horizontally centred around screen column `cx`, with the // top-left of the glyph row at `y`. Returns the X advance. int16_t fontDrawStringCentered(FramebufferT *fb, int16_t cx, int16_t y, const char *s, ColorE color); #endif