diff options
author | cflip <cflip@cflip.net> | 2023-01-10 17:31:27 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-10 17:31:27 -0700 |
commit | 3eaf3418928e9e9eac271961a983b720a7989972 (patch) | |
tree | bc2c4995aadbf5c1d0a8bf9f6df628d0b4647823 /window.c | |
parent | 0cd5d2b28f7529f4f9f7b31b9f54e76ada76d9b7 (diff) |
Parse unicode tables in PSF fonts
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -97,15 +97,21 @@ static void draw_font_text(struct append_buffer *buffer) for (int i = 0; i < buffer->length; i++) { const char letter = buffer->buffer[i]; - if (letter > 128) { - printf("TODO: Non-ASCII characters are not currently supported.\n"); + if (letter == ' ') { + dstrect.x += font.width; continue; } + + int glyph_index = letter; + if (font.unicode_desc != NULL) { + glyph_index = font.unicode_desc[glyph_index]; + } + dstrect.w = font.width; dstrect.h = font.height; - srcrect.x = letter * 8; + srcrect.x = glyph_index * 8; srcrect.y = 0; srcrect.w = font.width; srcrect.h = font.height; |