aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-03-19 19:35:35 +0100
committerThomas White <taw@bitwiz.org.uk>2016-03-19 19:35:35 +0100
commit44e484efec8838a3a0da0b88207d84939226d165 (patch)
tree4083e46b5dca88eb054c47907f2d6e9d66e10762 /src
parenta8313420536449b101cf73fa527b6d8435cece39 (diff)
Add oblique and italic
Diffstat (limited to 'src')
-rw-r--r--src/sc_interp.c28
1 files changed, 28 insertions, 0 deletions
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);