Sunday, October 14, 2018

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.



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.



step1



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


step2



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


step3




  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.


step6



  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:



adjustments



  1. Finally, group the text and the two rectangles, and you're all set!


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...