diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-09 00:10:22 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-09 00:10:22 -0400 |
commit | ef5cd6e10e93ef973536d2df2ad57ac42a2118ea (patch) | |
tree | fb48ab2dc9caaa4fb2f7703c317e232671d786a9 /display.c | |
parent | 7b94ce2eb3319875de5da0212f3435a2fb1adc83 (diff) | |
download | runes-ef5cd6e10e93ef973536d2df2ad57ac42a2118ea.tar.gz runes-ef5cd6e10e93ef973536d2df2ad57ac42a2118ea.zip |
handle newlines vaguely better
Diffstat (limited to 'display.c')
-rw-r--r-- | display.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,5 @@ +#include <string.h> + #include "runes.h" void runes_display_init(RunesTerm *t) @@ -11,7 +13,16 @@ void runes_display_init(RunesTerm *t) void runes_display_glyph(RunesTerm *t, char *buf, size_t len) { if (len) { + char *nl; buf[len] = '\0'; + while ((nl = strchr(buf, '\n'))) { + double x, y; + *nl = '\0'; + cairo_show_text(t->cr, buf); + buf = nl + 1; + cairo_get_current_point(t->cr, &x, &y); + cairo_move_to(t->cr, 0.0, y + 14.0); + } cairo_show_text(t->cr, buf); } } |