diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-02-25 22:53:33 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-02-25 22:53:33 +0100 |
commit | 2cd7252202c10ef8918ce8885cdf26dd5fcf00f5 (patch) | |
tree | d81a0fae4c7f4c6d5869da480293a6b897714f46 /libstorycode/slide_render_cairo.c | |
parent | 916b00a9ec80e5647ddd13bc32c7cbe64d8b42ee (diff) |
Render slide titles and presentation titles
Diffstat (limited to 'libstorycode/slide_render_cairo.c')
-rw-r--r-- | libstorycode/slide_render_cairo.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libstorycode/slide_render_cairo.c b/libstorycode/slide_render_cairo.c index 7942d27..81b78ef 100644 --- a/libstorycode/slide_render_cairo.c +++ b/libstorycode/slide_render_cairo.c @@ -64,7 +64,8 @@ static PangoAlignment to_pangoalignment(enum alignment align) static void render_text(struct slide_item *item, cairo_t *cr, PangoContext *pc, - Stylesheet *ss, double parent_w, double parent_h) + Stylesheet *ss, enum style_element el, + double parent_w, double parent_h) { int i; double x, y, w, h; @@ -80,7 +81,7 @@ 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); - font = stylesheet_get_font(ss, STYEL_SLIDE_TEXT, fgcol, &align); + font = stylesheet_get_font(ss, el, fgcol, &align); if ( font == NULL ) return; fontdesc = pango_font_description_from_string(font); @@ -212,7 +213,7 @@ int slide_render_cairo(Slide *s, cairo_t *cr, ImageStore *is, Stylesheet *styles switch ( s->items[i].type ) { case SLIDE_ITEM_TEXT : - render_text(&s->items[i], cr, pc, stylesheet, + render_text(&s->items[i], cr, pc, stylesheet, STYEL_SLIDE_TEXT, s->logical_w, s->logical_h); break; @@ -221,6 +222,16 @@ int slide_render_cairo(Slide *s, cairo_t *cr, ImageStore *is, Stylesheet *styles s->logical_w, s->logical_h); break; + case SLIDE_ITEM_SLIDETITLE : + render_text(&s->items[i], cr, pc, stylesheet, STYEL_SLIDE_SLIDETITLE, + s->logical_w, s->logical_h); + break; + + case SLIDE_ITEM_PRESTITLE : + render_text(&s->items[i], cr, pc, stylesheet, STYEL_SLIDE_PRESTITLE, + s->logical_w, s->logical_h); + break; + default : break; |