I cant draw and format prawn text properly

115 Views Asked by At

Can you help me?? I need to draw one line text in prawn pdf with responsible text size which depends on text characters count... Less chacters count -> bigger text size.

bounding_box([header_text_left_margin, @height + 26], :width=>270, :height=>250) do
 text developer_position, :size => 40, :leading => 1
end
1

There are 1 best solutions below

0
gettalong On

Have a look at the Prawn manual page 38 "text/text_box_overflow.rb". There you will find that an option :shrink_to_fit exists which will do what you want. Just make sure that the initial font size is large enough.