diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-02 22:37:14 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-05 21:01:01 +0300 |
commit | 4a98d92489b3c404ae1d7320c27cadd9446fa5bf (patch) | |
tree | a92a9325243e0e79d5a347d432b4d10e3e0aa206 | |
parent | bc80fc8849a01ac156c5e54ba8ef3fe04e1aaee3 (diff) | |
download | subsurface-4a98d92489b3c404ae1d7320c27cadd9446fa5bf.tar.gz |
Printing: export template_options struct to Grantlee engine
Add template_options to Grantlee lookup section and export the struct
fields.
-font: is the font type used, must be selcted from 5 different types.
-font-size: is a user selection from 9 - 18 then it is scaled to a range
from 1 to 2 of the displaying view port.
-color-palette: is the colors used in the template, all used colors must be
referenced from here.(not yet implemented)
-line-spacing: is the distance between two consecutive lines in the dive
notes text.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r-- | templatelayout.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/templatelayout.h b/templatelayout.h index a894ce4ca..854a16259 100644 --- a/templatelayout.h +++ b/templatelayout.h @@ -104,4 +104,25 @@ else if (property == "notes") return object.notes(); GRANTLEE_END_LOOKUP +GRANTLEE_BEGIN_LOOKUP(template_options) +if (property == "font") { + switch (object.font_index) { + case 0: + return "Arial, Helvetica, sans-serif"; + case 1: + return "Impact, Charcoal, sans-serif"; + case 2: + return "Georgia, serif"; + case 3: + return "Courier, monospace"; + case 4: + return "Verdana, Geneva, sans-serif"; + } +} else if (property == "font_size") { + return object.font_size / 9.0; +} else if (property == "line_spacing") { + return object.line_spacing; +} +GRANTLEE_END_LOOKUP + #endif |