diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-09-19 21:17:56 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-09-19 21:17:56 +0100 |
commit | 50d06345810cf849548b95e92973f8466b7d5754 (patch) | |
tree | 246b15c123dcc2da25c30f52ed095697ab40c3f2 /src | |
parent | 3197befed5cc86b82c92677b5040fd37d9a30974 (diff) | |
download | uboxlib-dos-50d06345810cf849548b95e92973f8466b7d5754.tar.gz uboxlib-dos-50d06345810cf849548b95e92973f8466b7d5754.zip |
COnfigurable width and hegith
Diffstat (limited to 'src')
-rw-r--r-- | src/text.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,21 +1,25 @@ #include <stdint.h> #include "ubox_vga.h" +#include "ubox_text.h" static const uint8_t *font; +static uint8_t w, h; -void ubox_set_font(const uint8_t *pixdata) +void ubox_set_font(const uint8_t *pixdata, uint8_t width, uint8_t height) { font = pixdata; + w = width; + h = height; } void ubox_put_text(uint16_t x, uint16_t y, const char *text, uint8_t color) { - ubox_rect dst = { x, y, 8, 8}; + ubox_rect dst = { x, y, w, h}; while (*text) { - ubox_blit_c(font + ((*text++ - ' ') << 6), &dst, color); - dst.x += 8; + ubox_blit_c(font + ((*text++ - ' ') * w * h), &dst, color); + dst.x += w; } } |