21 lines
630 B
C
21 lines
630 B
C
// 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 <stdint.h>
|
|
#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);
|
|
|
|
#endif
|