Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Consistent box padding around text

I'm building a generator that has text on top of a linked background. I need the background to retain its scale regardless of the length of text in the text box so that there is always the same amount of box around the padding, no matter how long or short the text is.


The text has instances of both left and right-justified depending on which side of the frame it needs to be on. I'm using paragraph text.


I have tried many combinations of all of the settings I can think of, both of the objects themselves and inside of the links and behavior attributes, but cannot get anything consistent.


The closest I've gotten is that when the top line of text is closer to the edge of the box, the padding is correct, but when I have shorter stacks of text (three words on top line, three words on bottom line), there is four times the amount padding on the shape that what I want.


Is there a way to get consistent padding around text boxes? Is there a plugin that would help with this?


Thank you!

Posted on Mar 8, 2021 9:43 AM

Reply

Similar questions

8 replies

Mar 9, 2021 11:06 AM in response to fox_m

Yes, my text is in Paragraph layout.


Here is my left-aligned text with background box. I adjusted the x offset in the rectangle's "align to" behavior to make it flush with the left edge of the frame.


When the text is written out without a carriage return, the padding on the right edge is correct (after the "or").



If I have shorter text that needs to be displayed more evenly across the background and insert a carriage return, there is no padding around the text unless I add a space before the carriage return.


This is without the extra space before the carriage return.



Here is the second option with a space before the carriage return:


It is a subtle difference, but I've been tasked with creating the motion template based on a design created by someone else and I'm trying to match it. I also need it to work without adding a space because the people who will be using this template will not remember to add the space and we are trying to make everything we create uniform.


So I'm looking for how to make the box flush with the frame edge and still retain the correct padding on the inside edge of the text/background box.


Thank you!

Mar 8, 2021 10:26 AM in response to blazen

To set up a background for text no matter what its length or justification or where you move the text on the canvas:


To the Rectangle > Shape > Geometry > Size parameter, add a Link. Drag the text into the source.


In Compatible Parameters, you should find Object Attributes. The only option for this will be Size > All. Select that.


The rectangle will now always match the bounding box of the text. For Padding, adjust the X Offset and Y Offset parameters at the bottom of the link behavior.


To the Rectangle, add a Behaviors > Basic Motion > Align To. Drag the Text object into the source (Object) well. It defaults to Center / Center which is what you will want.



Mar 8, 2021 12:03 PM in response to fox_m

Thank you for the response!


Is there a way to control just one side of the box independently of the other? I have other instances where the box needs to be flush with the frame (i.e. left edge), and when I change the "align to" offset to position it, the edge closest to the end of the text (i.e. right edge) is off by a space when the return key is used to start the second line of text. The box is no longer uniform on the text edge to the boxes that are centered.


Can this be corrected for?


Thank you!



Mar 8, 2021 2:12 PM in response to blazen

I'm not sure what you mean...


The Link Size will be sensitive to extra spaces on a line, carriage returns, there's also a difference if descenders are involved as opposed to when they are not. Align To seems to react to *1* space at the line end (it will widen evenly), but multiple spaces will skew the rectangle off to the right. If you're careful with what you type, it should work out.


If you need negative offsets in the Link, you can click on the number values of X Offset and Y Offset and drag down to get negative values.


Can you post a couple of screen shots of the trouble you're having illustrating the point at which things change?

Consistent box padding around text

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.