From 4a98d92489b3c404ae1d7320c27cadd9446fa5bf Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Thu, 2 Jul 2015 22:37:14 +0200 Subject: 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 Signed-off-by: Lubomir I. Ivanov --- templatelayout.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 -- cgit v1.2.3-70-g09d2