ruby prawn如何围绕对齐的右图包装文字?

是否可以将图像右对齐并在图像周围包装文本,就像在html和css中使用float:right属性一样?

如果是这样,你怎么做?

我可以对齐图像,但不知道如何包装文本。 文本是动态文本因此长度变化很多。

非常感谢Rick

一个建议是尝试嵌套的边界框。 主边界框将包含文本。 在某些时候,图像的另一个边界框。 有点像

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 

您可以在没有边界框的情况下简单地使用图像,但边界框将确保文本在其周围流动。