Text Option Align Right (Escape string ins't working)

19 views
Skip to first unread message

Max Pereira

unread,
Mar 7, 2016, 5:58:40 PM3/7/16
to Prawn
Hi All... I have the sample code 




bounding_box([0, cursor],:width => @width, :height => 300) do

 text "    _________________________   __________________________   __________________________      ", :align => :center, :valign => :bottom       

text "\0 Antonio Pereira Pinto", :align => :left,:valign => :bottom
text "Jurandir Ferreira Francisco", :align => :center,:valign => :bottom
text "Pedro Alcantara Freitas \0", :align => :right,:valign => :bottom
 transparent(0.5) { stroke_bounds }
end

I wanna put a whitespace in the last one ("Pedro Alcantara Freitas") ... I tryed \0 and \t but seems like it dont work with align right... 
any ideas?

John

unread,
Mar 7, 2016, 6:54:35 PM3/7/16
to Prawn
Using Prawn's non-breaking space might work for you:

text "Pedro Alcantara Freitas #{Prawn::Text::NBSP}"


Max Pereira

unread,
Mar 12, 2016, 5:02:04 PM3/12/16
to Prawn
Thanks John! helped a lot :)
Reply all
Reply to author
Forward
0 new messages