aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
blob: 81e348bec7280328525d6181a96839fe3c826d42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <cairo.h>

#include "runes.h"

void runes_display_init(RunesTerm *t)
{
    cairo_select_font_face(t->cr, "monospace", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size(t->cr, 14.0);
    cairo_set_source_rgb(t->cr, 0.0, 0.0, 1.0);
    cairo_move_to(t->cr, 0.0, 14.0);
}

void runes_display_glyph(RunesTerm *t, char *buf, size_t len)
{
    if (len) {
        buf[len] = '\0';
        cairo_show_text(t->cr, buf);
        cairo_surface_flush(t->surface);
    }
}