From 2236dea3df2e651a75788334c439f1ad312709f4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 21 Oct 2018 18:08:06 +0200 Subject: Honour alignment in stylesheet --- src/sc_interp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sc_interp.c b/src/sc_interp.c index 010b100..ef3c7df 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -989,6 +989,22 @@ static void apply_style(SCInterpreter *scin, Stylesheet *ss, const char *path) result = stylesheet_lookup(ss, fullpath); if ( result != NULL ) set_paraspace(scin, result); + /* Alignment */ + strcpy(fullpath, path); + strcat(fullpath, ".alignment"); + result = stylesheet_lookup(ss, fullpath); + if ( result != NULL ) { + if ( strcmp(result, "center") == 0 ) { + set_alignment(scin, PANGO_ALIGN_CENTER); + } + if ( strcmp(result, "left") == 0 ) { + set_alignment(scin, PANGO_ALIGN_LEFT); + } + if ( strcmp(result, "right") == 0 ) { + set_alignment(scin, PANGO_ALIGN_RIGHT); + } + } + update_bg(scin); } -- cgit v1.2.3