| git.druid.rocks | index | militantprogrammer | astral_canvas | src/ | render/ | font.h |
src/render/font.h
#ifndef FONT_H
#define FONT_H
#include <stdint.h>
enum {
FONT_GLYPH_W = 8,
FONT_GLYPH_H = 8,
FONT_FIRST = 32,
FONT_LAST = 126,
FONT_COUNT = FONT_LAST - FONT_FIRST + 1,
FONT_ATLAS_COLS = 16,
FONT_ATLAS_ROWS = 6,
FONT_ATLAS_W = FONT_ATLAS_COLS * FONT_GLYPH_W,
FONT_ATLAS_H = FONT_ATLAS_ROWS * FONT_GLYPH_H,
};
/* 8-byte glyph bitmap (LSB = leftmost pixel). Out-of-range → '?'. */
const unsigned char *font_glyph(unsigned char character);
/* CPU blit of ASCII text into an XRGB8888 buffer. Placeholder until TTF. */
void font_draw(uint32_t *pixels, int stridePixels, int bufferWidth, int bufferHeight,
int x, int y, const char *text, uint32_t color, int scale);
#endif