Ruby shrimp, how to wrap text around a aligned right image?

s, you can align the image to the right and wrap text around the image, as in html and css, using the float: right property?

If so, how do you do it?

I can align the image, but I don’t know how to wrap the text around it. The text is dynamic text, so it changes in length.

Thanks a lot Rick

+2
source share
1 answer

One suggestion is to try nested bounding boxes. The main bounding box will contain the text inside it. at some point, another bounding box for the image. Something along the lines

bounding_box([x,y], :width => bounds.width, :height => 400) do text "blah" text "blah" # image bounding_box([bounds.right - image_width, 0], :width => image_width) do image("path_to_file", :at => [0,0], :width => bounds) text "more blah" end 

You can simply use an image without a bounding box, but a bounding box will ensure that text flows around it.

+1
source

Source: https://habr.com/ru/post/1307702/


All Articles