From 44e484efec8838a3a0da0b88207d84939226d165 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 19 Mar 2016 19:35:35 +0100 Subject: Add oblique and italic --- src/sc_interp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/sc_interp.c') diff --git a/src/sc_interp.c b/src/sc_interp.c index 70317a6..35531b6 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -342,6 +342,24 @@ static void set_bold(SCInterpreter *scin) } +static void set_oblique(SCInterpreter *scin) +{ + struct sc_state *st = &scin->state[scin->j]; + copy_top_fontdesc(scin); + pango_font_description_set_style(st->fontdesc, PANGO_STYLE_OBLIQUE); + update_font(scin); +} + + +static void set_italic(SCInterpreter *scin) +{ + struct sc_state *st = &scin->state[scin->j]; + copy_top_fontdesc(scin); + pango_font_description_set_style(st->fontdesc, PANGO_STYLE_ITALIC); + update_font(scin); +} + + /* This sets the colour for the font at the top of the stack */ static void set_colour(SCInterpreter *scin, const char *colour) { @@ -942,6 +960,16 @@ int sc_interp_add_blocks(SCInterpreter *scin, SCBlock *bl) set_bold(scin); maybe_recurse_after(scin, child); + } else if ( strcmp(name, "oblique") == 0 ) { + maybe_recurse_before(scin, child); + set_oblique(scin); + maybe_recurse_after(scin, child); + + } else if ( strcmp(name, "italic") == 0 ) { + maybe_recurse_before(scin, child); + set_italic(scin); + maybe_recurse_after(scin, child); + } else if ( strcmp(name, "fgcol") == 0 ) { maybe_recurse_before(scin, child); set_colour(scin, options); -- cgit v1.2.3