aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2018-10-21 18:08:06 +0200
committerThomas White <taw@bitwiz.me.uk>2018-10-21 18:08:06 +0200
commit2236dea3df2e651a75788334c439f1ad312709f4 (patch)
treedaf1a5fbbe2eba0ea6f737bc33e6a81d0d9a291e
parent27e08c96c71183edea9be3e189d7152c19b1beac (diff)
Honour alignment in stylesheet
-rw-r--r--src/sc_interp.c16
1 files changed, 16 insertions, 0 deletions
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);
}