Border around formatted text in Inkscape


I'm trying to create a block of text with formatting and I want to surround it with a border. I've tried the "Flow into frame" feature, but that removes formatting (I would like line breaks, spaces, bold, etc...).

Right now, I'm manually drawing a rectangle around it and aligning it (using the align and distribute functions). Is there a way to automate this and produce consistent results? My current technique does not guarantee even spacing from the border to text of multiple boxes like these.

8/10/2014 3:31:00 PM

Accepted Answer

Yes! Here is the end result:

end result

Step by step:

  1. Create some flowed text by using the text tool to first drag a rectangle and then type.


  1. Separately, create a rectangle roughly around the text (really, the rectangle can be anywhere)


  1. With the rectangle selected, chose "Path" > "Linked Offset". Then grab the small diamond and drag it in to make a second, smaller rectangle.


  1. Select the text and the smaller rectangle and choose "Text" > "Flow into frame". Then select the smaller rectangle and remove the stroke to make it invisible. Now the text will flow within the smaller (invisible) rectangle, which is dynamically linked to the shape of the larger (visible) rectangle.


  1. Then, if you like, you can add a small border radius on the visible rectangle and you get this nice looking result.

end result

  1. If you do need to modify the space between the text and the rectangle, you can carefully select it by grabbing it with the text and the subtracting the text from the selection, or you can drill down to it within the XML Editor. When you do get it selected, then you can adjust the margin as follows:


  1. Finally, group the text and the two rectangles, and you're all set!
10/30/2014 8:35:00 PM