From b9c16eb6d903ab809b340d404139dcaa1872ea9c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 25 Feb 2019 21:48:42 +0100 Subject: Use text font --- libstorycode/slide_render_cairo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libstorycode/slide_render_cairo.c') diff --git a/libstorycode/slide_render_cairo.c b/libstorycode/slide_render_cairo.c index 7e1cc91..b7e3f15 100644 --- a/libstorycode/slide_render_cairo.c +++ b/libstorycode/slide_render_cairo.c @@ -68,6 +68,9 @@ static void render_text(struct slide_item *item, cairo_t *cr, PangoContext *pc, { int i; double x, y, w, h; + const char *font; + enum alignment align; + double fgcol[4]; PangoRectangle rect; PangoFontDescription *fontdesc; @@ -76,7 +79,10 @@ static void render_text(struct slide_item *item, cairo_t *cr, PangoContext *pc, w = lcalc(item->geom.w, parent_w); h = lcalc(item->geom.h, parent_h); - fontdesc = pango_font_description_from_string(stylesheet_get_slide_text_font(ss)); + font = stylesheet_get_font(ss, STYEL_SLIDE_TEXT, fgcol, &align); + if ( font == NULL ) return; + + fontdesc = pango_font_description_from_string(font); if ( item->layouts == NULL ) { item->layouts = malloc(item->n_paras*sizeof(PangoLayout *)); @@ -107,7 +113,7 @@ static void render_text(struct slide_item *item, cairo_t *cr, PangoContext *pc, /* FIXME: Clip to w,h */ cairo_save(cr); - cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0); + cairo_set_source_rgba(cr, fgcol[0], fgcol[1], fgcol[2], fgcol[3]); cairo_translate(cr, x, y); pango_cairo_update_layout(cr, item->layouts[i]); pango_cairo_show_layout(cr, item->layouts[i]); -- cgit v1.2.3