microsoft / microsoft/microsoft-ui-xaml
Text block with italic and justified text seems to be cut off
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
It seems that italic font is not taken into account by text blocks and as a result some characters might not be displayed fully.
### Steps to reproduce the bug
The following XAML code reproduces the issue:
```xaml
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
```
(See https://github.com/MartyIX/WinUiDemos/tree/feature/2024-09-15-TextBlock-italic-and-justify and https://github.com/MartyIX/WinUiDemos/commit/76c0d044c756ac689996e816e445aef8c65db3c6)
It displays as follows:

where `f` (and other characters) is not fully visible:

### Expected behavior
All characters should be fully displayed.
### Screenshots
_No response_
### NuGet package version
None
### Windows version
Windows 11 (22H2): Build 22621
### Additional context
As a workaround one can set the `Padding` attribute of `` - e.g.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
The result is then:

Contributor guide
Research direction
Start with the linked WinUiDemos XAML reproduction and verify the clipping with italic, justified, wrapped TextBlock content. Trace the text layout and rendering path responsible for that scenario; done means all characters display fully without requiring extra Padding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100