[Enhancement] Text Extensions. TextBlock Vertical Trim
Hello! While working with the layout, I came across this thing. I have a small header with text. I want to set the height of the Border to be based on the height of the largest glyph. In my case the text has the number 24. The default text height includes vertical padding. I'd like to get rid of these indentations using a new text property. I see that you already have your own Noesis extension for various elements, including text.
I propose adding a new TextTrimVertical property that would allow for more precise text positioning and alignment. I haven't found a similar property and implementation in WPF. There is a similar property in CSS, but browsers do not currently support it.
https://caniuse.com/css-text-box-trim
An example of how a property works in CSS: https://text-box-trim.vercel.app/?c=BYR ... HMI+EirDoA
I drew a layout in Figma similar to the layout implementation in xaml, which displays the layout behavior with and without vertical text indentation (Figma has a VerticalTrim text property to remove vertical text indentation)
In the figure you can see that with the VerticalTrim property it was possible to align the number of living players and the text “Players Alive” along one line.
Of course you can use a negative Padding value for a TextBlock , but it doesn't have the same effect as VerticalTrim because the number glyphs may not be perfectly centered. In the example I'm using the Verdana font.
I propose adding a new TextTrimVertical property that would allow for more precise text positioning and alignment. I haven't found a similar property and implementation in WPF. There is a similar property in CSS, but browsers do not currently support it.
https://caniuse.com/css-text-box-trim
An example of how a property works in CSS: https://text-box-trim.vercel.app/?c=BYR ... HMI+EirDoA
I drew a layout in Figma similar to the layout implementation in xaml, which displays the layout behavior with and without vertical text indentation (Figma has a VerticalTrim text property to remove vertical text indentation)
In the figure you can see that with the VerticalTrim property it was possible to align the number of living players and the text “Players Alive” along one line.
Of course you can use a negative Padding value for a TextBlock , but it doesn't have the same effect as VerticalTrim because the number glyphs may not be perfectly centered. In the example I'm using the Verdana font.
Re: [Enhancement] Text Extensions. TextBlock Vertical Trim
This is a very interesting feature. Could you please create a ticket for this?
As you said, you can achieve something similar playing with the Margin property.
As you said, you can achieve something similar playing with the Margin property.
Re: [Enhancement] Text Extensions. TextBlock Vertical Trim
Thanks for your feedback! I created a ticket, here is the link: https://www.noesisengine.com/bugs/view.php?id=3113This is a very interesting feature. Could you please create a ticket for this?
As you said, you can achieve something similar playing with the Margin property.
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 4 guests