View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003113 | NoesisGUI | C# SDK | public | 2024-02-21 20:20 | 2024-02-23 10:03 |
| Reporter | Demond | Assigned To | jsantos | ||
| Priority | normal | Severity | feature | ||
| Status | assigned | Resolution | open | ||
| Product Version | 3.2 | ||||
| Summary | 0003113: TextBlock Vertical Trim. Text Extensions | ||||
| Description | 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=BYRgBA3gUGYEYEMDGBrA5gJwPYFcB2AJgLRJYA2WGAXGBgKYEDcMYALnQB6tFxYdGsMASwC2NXq2DNY7Ljz5EGaOjSQIADmARl1wBHDqshSZgF8APAHpLAPnOgbAFU6teHMI%20EirDoA 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. | ||||
| Attached Files | |||||
| Platform | Any | ||||