aboutsummaryrefslogtreecommitdiff
path: root/src/text.c
blob: 6cec4ad3f6ff7289e1c3b0c36d11417639972608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdint.h>

#include "ubox_vga.h"

static const uint8_t *font;

void ubox_set_font(const uint8_t *pixdata)
{
    font = pixdata;
}

void ubox_put_text(uint16_t x, uint16_t y, const char *text, uint8_t color)
{
    ubox_rect dst = { x, y, 8, 8};

    while (*text)
    {
        ubox_blit_c(font + ((*text++ - ' ') << 6), &dst, color);
        dst.x += 8;
    }
}