#if 0 #include "vhex/display.h" #include "vhex/defs/types.h" #include #include //TODO: dynamic extern struct { uint32_t width; uint32_t height; uint32_t pixel[]; } font8x9; /* dtext_opt(): Display a string of text */ void dtext_opt( int x, int y, int fg, int bg, int halign, int valign, char const *str, int size ) { int height; int width; if (size < 0) size = 65535; dnsize(str, size, &width, &height); if (halign == DTEXT_CENTER) x = x - (width / 2); if (halign == DTEXT_RIGHT) x = x - (width); if (valign == DTEXT_CENTER) y = y - (height / 2); if (valign == DTEXT_BOTTOM) y = y - (height); //TODO: line-discipline for (int i = 0; str[i] != '\0' && i < size; ++i) { dascii(x, y, fg, bg, str[i]); x += font8x9.width + 1; } } /* dtext() : display text information */ void dtext(int x, int y, int fg, char const * restrict const text) { dtext_opt(x, y, fg, C_NONE, DTEXT_LEFT, DTEXT_TOP, text, -1); } void dprint(int x, int y, int fg, char const * const text, ...) { va_list ap; char buff[1024]; va_start(ap, text); vsnprintf(buff, 1024, text, ap); va_end(ap); dtext_opt(x, y, fg, C_NONE, DTEXT_LEFT, DTEXT_TOP, buff, -1); } #endif