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>
This commit is contained in:
Gehad elrobey 2015-07-02 22:37:14 +02:00 committed by Lubomir I. Ivanov
parent bc80fc8849
commit 4a98d92489

View file

@ -104,4 +104,25 @@ else if (property == "notes")
return object.notes(); return object.notes();
GRANTLEE_END_LOOKUP 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 #endif