mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
bc80fc8849
commit
4a98d92489
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue