git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@66 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-29 09:16:44 +00:00
parent 38a109e8df
commit 278a86951e
4 changed files with 196 additions and 134 deletions

View File

@@ -118,20 +118,21 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
void MwDrawText(MwWidget handle, MwPoint* point, const char* text, MwLLColor color) {
int i, x, y, sx, sy, sc = 1;
int fw = 7, fh = 14;
MwRect r;
sx = point->x - strlen(text) * 8 * sc / 2;
sy = point->y - 16 * sc / 2;
sx = point->x - strlen(text) * fw * sc / 2;
sy = point->y - fh * sc / 2;
for(i = 0; text[i] != 0; i++) {
for(y = 0; y < 16; y++) {
for(x = 0; x < 8; x++) {
for(y = 0; y < fh; y++) {
for(x = 0; x < fw; x++) {
r.x = sx + x * sc;
r.y = sy + y * sc;
r.width = sc;
r.height = sc;
if(MwFontData[(unsigned char)text[i]].data[y] & (1 << (7 - x))) {
if(MwFontData[(unsigned char)text[i]].data[y] & (1 << ((fw - 1) - x))) {
MwDrawRect(handle, &r, color);
}
}