Jump to content
You must now use your email address to sign in [click for more info] ×

align text within a rectangle


Recommended Posts

Hello, 

I'm not sure where to ask this question.
Let's say I want to create a button in designer v2 and I created a rectangle and text layer:
1873942816_2023-03-28at10_58_27.png.62fec9ad79e70e83e6effa948789607e.png

But then I want to align text layer to the left or to the right of the parent layer.
943389450_2023-03-28at11_00_01.png.15fb9b7b434bf707c1f0b03eca37f4a7.png

but when I select the appropriate option in the alignment toolbar I get the text layer aligned to the page rather than parent layer:
7119425_2023-03-28at11_00_49.png.7f9ce6e66f0f850ba2a8f2775e1b0cba.png

The only way I found is to flatten the layers, select them, align them and put the text layer back into the rectangle layer.

I'm I doing something wrong?

Link to comment
Share on other sites

As additional information to that above, the Alignment functionalities available via the button on the Toolbar – and the “Layer → Alignment” menu items – are for aligning whole layers and not their content.

Also, the default “Align to” option is “Spread” which is where the software has aligned your text layer to, e.g. the left-hand edge of the spread (page).

If you want to align two layers centrally with each other then you can use either snapping, or the alignment functionalities, or the Alignment Handles, as shown in my attached video (and there might be other ways).

Link to comment
Share on other sites

In addition to the mentioned text align options and the snapping hint: Also adjusting the size of the text frame in width/height can make use of the snapping feature and thus cause a centred position (green example below).

Also note the various ways to combine the text layer with the button shape layer, each with advantages or disadvantages depending on your preferred workflow.

• The easiest may be the 1-object solution (yellow) which uses the button shape as text frame (while shape fill/stroke get set in the Text Frame panel).

• A Picture Frame (pinkish) offers the additional auto-centre button in its interface,

• The Pinning options use the auto centre settings (blue).
 

1461985908_textshapealign1-4.thumb.jpg.050b650cb2f14240d0ca0877c4cc004e.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

53 minutes ago, GarryP said:

As additional information to that above, the Alignment functionalities available via the button on the Toolbar – and the “Layer → Alignment” menu items – are for aligning whole layers and not their content.

Also, the default “Align to” option is “Spread” which is where the software has aligned your text layer to, e.g. the left-hand edge of the spread (page).

If you want to align two layers centrally with each other then you can use either snapping, or the alignment functionalities, or the Alignment Handles, as shown in my attached video (and there might be other ways).

Thank you for the reply. In your video the layers are on the same level. In my question, the text layer is «within» a rectangle (cause I need to use «constraints»).

Link to comment
Share on other sites

5 minutes ago, gorodinskiy said:

In my question, the text layer is «within» a rectangle (cause I need to use «constraints»).

Ah, sorry, I missed that.
In that case the Snapping and Alignment Handles (you need to drag rather than click) techniques should still work, unless I'm still missing something.

Link to comment
Share on other sites

10 minutes ago, thomaso said:

In addition to the mentioned text align options and the snapping hint: Also adjusting the size of the text frame in width/height can make use of the snapping feature and thus cause a centred position (green example below).

Also note the various ways to combine the text layer with the button shape layer, each with advantages or disadvantages depending on your preferred workflow.

• The easiest may be the 1-object solution (yellow) which uses the button shape as text frame (while shape fill/stroke get set in the Text Frame panel).

• A Picture Frame (pinkish) offers the additional auto-centre button in its interface,

• The Pinning options use the auto centre settings (blue).
 

1461985908_textshapealign1-4.thumb.jpg.050b650cb2f14240d0ca0877c4cc004e.jpg

Thank you for detailed reply!

Link to comment
Share on other sites

37 minutes ago, gorodinskiy said:

the text layer is «within» a rectangle (cause I need to use «constraints»)

Then the constraint settings override the align options anyway, don't they? – And, I guess, there is no need to nest the text as child inside the parent button shape … it maybe sufficient to simply group them, keeping them as two independent layers which can get aligned via the (auto-)align interface options.

967354545_textshapealigngroups.thumb.jpg.32ea54992a0246689053185e7b801e6d.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

13 minutes ago, thomaso said:

Then the constraint settings override the align options anyway, don't they? – And, I guess, there is no need to nest the text as child inside the parent button shape … it maybe sufficient to simply group them, keeping them as two independent layers which can get aligned via the (auto-)align interface options.

967354545_textshapealigngroups.thumb.jpg.32ea54992a0246689053185e7b801e6d.jpg

I might be wrong, but I think constraints only helps to specify how the layer behaves when parent layer is resized.

The solution with groups might work. I just thought that nesting is best way to go about creating such elements as buttons, since you have a parent container that englobes all the content layers.

Link to comment
Share on other sites

On 3/29/2023 at 9:24 AM, gorodinskiy said:

I might be wrong, but I think constraints only helps to specify how the layer behaves when parent layer is resized.

"only"? I am unsure what you want to express exactly. – However, as illustrated there are various ways to achieve parent & nested child layers. "Constraints" are rather helpful for more complex layouts, where usually more than two objects should maintain specific position or size while others should respect different or even none when their parent container gets resized.

The easiest (just 1 layer) would be to convert the button shape into a text frame (the yellow sample above) – but unfortunately it works well in APub while it lacks in AD in the missing access to the fill colour of the object, which gets lost once you convert the rounded rectangle object into a text shape object. Also the pinning feature is not available in AD but APub only.

So it seems the normal Group (not Constraints) or a layer of type "Layer" would be the most effective workflow here. Just make sure not to use the Art Text Tool but the Frame Text Tool for the initial text creation – otherwise the text will get stretched when the group gets resized. And make use of the text alignment options within the text frames to maintain the left or centred position when the group layer gets widened.

Note: in the video below the selection of 4 separate layers was just done to make the 4 bounding boxes visible. In fact you "actually" would select the two parent group layers instead (which also avoids the horizontal offset done to the art text layer at the end of the clip)

Edited by thomaso
note about selection added

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.