MightyBear

Text Box Trimming

16 May 2025, 18:03

Hey Noesis forum!

little quick one for you (hopefully), When using a text box, is there a way to apply vertical trim as seen in figma, so that the bounding box hugs the top and bottom of the text?

I see that there is "Text Trimming" that can be set to CharacterEllipsis, but it seems to have no effect when turned on.

Any help Much appreciated!
Attachments
Screenshot 2025-05-16 165852.png
Screenshot 2025-05-16 165852.png (55.96 KiB) Viewed 12737 times
 
User avatar
dstewart
Site Admin
Posts: 134
Joined: 22 Jan 2024, 11:41

Re: Text Box Trimming

16 May 2025, 18:28

Hi Ken! Dorian here!

The TextBlock Element comes with a Padding Property, which when set to negative values, can help you achieve the result you're looking for.
What's cool too is that these are not just a visual change in the adorner, but will also impact the physical footprint of the TextBlock within a layout.

TextHeight.jpg

The Text Trimming Property on the other hand has more to do with how a TextBlock reacts when there is not enough room for the entirety of the content to fit within an allocated space. So for example, in the below, the lower TextBlock is given less dimensional space than the upper TextBlock; and because its set to have Text Trimming, it displays as much text as possible in the space available, minus the room required to add in the ellipsis.

TextTrimming.jpg

Let us know if this helps!
 
MightyBear

Re: Text Box Trimming

19 May 2025, 16:59

That was perfect! Thank you!!
 
User avatar
dstewart
Site Admin
Posts: 134
Joined: 22 Jan 2024, 11:41

Re: Text Box Trimming

19 May 2025, 17:31

Fantastic; thrilled to hear! Thanks for reporting back!

Who is online

Users browsing this forum: No registered users and 1 guest