summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/window.c b/window.c
index 1e6d5f2..7f29abe 100644
--- a/window.c
+++ b/window.c
@@ -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;