|
|
@ -25,7 +25,27 @@ module OpenProject::PdfExport::ExportCard |
|
|
|
text = text + "#{@work_package.class.human_attribute_name(@property_name)}: " if has_label |
|
|
|
text = text + "#{@work_package.class.human_attribute_name(@property_name)}: " if has_label |
|
|
|
text = text + value |
|
|
|
text = text + value |
|
|
|
|
|
|
|
|
|
|
|
font_size = Integer(@config['font_size']) # TODO: Not safe! |
|
|
|
# Font size |
|
|
|
|
|
|
|
if @config['font_size'] |
|
|
|
|
|
|
|
# Specific size given |
|
|
|
|
|
|
|
overflow = :truncate |
|
|
|
|
|
|
|
font_size = Integer(@config['font_size']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elsif @config['min_font_size'] |
|
|
|
|
|
|
|
# Range given |
|
|
|
|
|
|
|
overflow = :shrink_to_fit |
|
|
|
|
|
|
|
min_font_size = Integer(@config['min_font_size']) |
|
|
|
|
|
|
|
font_size = if @config['max_font_size'] |
|
|
|
|
|
|
|
Integer(@config['max_font_size']) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
min_font_size |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
# Default |
|
|
|
|
|
|
|
font_size = 12 |
|
|
|
|
|
|
|
overflow = :truncate |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
font_style = (@config['font_style'] or "normal").to_sym |
|
|
|
font_style = (@config['font_style'] or "normal").to_sym |
|
|
|
text_align = (@config['text_align'] or "left").to_sym |
|
|
|
text_align = (@config['text_align'] or "left").to_sym |
|
|
|
|
|
|
|
|
|
|
@ -35,9 +55,10 @@ module OpenProject::PdfExport::ExportCard |
|
|
|
{:height => @orientation[:height], |
|
|
|
{:height => @orientation[:height], |
|
|
|
:width => @orientation[:width], |
|
|
|
:width => @orientation[:width], |
|
|
|
:at => offset, |
|
|
|
:at => offset, |
|
|
|
:size => font_size, |
|
|
|
|
|
|
|
:style => font_style, |
|
|
|
:style => font_style, |
|
|
|
:overflow => :truncate, |
|
|
|
:overflow => overflow, |
|
|
|
|
|
|
|
:size => font_size, |
|
|
|
|
|
|
|
:min_font_size => min_font_size, |
|
|
|
:align => text_align}) |
|
|
|
:align => text_align}) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|