-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Describe the bug
On Windows, compared to WPF and browsers like Edge and Chrome, some fonts are rendered with the wrong baseline. Some also gets the wrong bounds.
For example:
- Bahnschrift
- Baskerville Old Face
- Bauhaus 93
- Britannic
- Cambria Math
- Footlight MT
To Reproduce
Run the attached project, it draws the system fonts using Avalonia and WPF side by side using the same font size and with layout rounding turned off in Avalonia to get similar results as WPF. WPF pixel aligns each row so we'll never get a pixel perfect result, but it shouldn't diff more than one screen px and the bounding boxes should be equal.
The Avalonia control NoLayoutRoundingTextBlock is just a TextBlock but the always on layout rounding is ignored to get more similar bounding boxes to WPF.
I've tried to draw a line where the baseline is and in Avalonia the ascent and descent.
Comparing bounds to results in browser, Edge in this case.
Expected behavior
Avalonia should render text at the same baseline and with the same bounds as WPF and web browsers.
Avalonia version
11.3.4
OS
Windows
Additional context
No response