You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line spacing between new lines in a DWriteCore text layout are not consistent or fractional. On smaller font sizes this becomes a noticable issue. Since it is a bit harder to show due to the small sizes in the TextRendering sample, I use my own application. This is at a point size of 72, and then scaled down to fit on the screen. The lines here seem mostly even.
However, if I use a point size of 3, you can start seeing the difference in line spacing:
and even more extreme, point size 0.5:
some new lines do not even give a different value compared to the previous line's baselineOriginY in IDWriteTextRenderer1::DrawGlyphRun.
This is most likely due to the fact that the difference in baselineOriginY do not properly scale with font size, as can be seen in the attached videos.
Steps to reproduce the bug
create a text layout with multi-line text, I just used some from the main page of https://www.lipsum.com/.
make the text layout have a maximum width, so it wraps the words, without needing explicit new-lines.
set the font size at quite small, so the non-fractional baselineOriginY becomes an issue.
set the font size even smaller to where multiple lines sometimes have the same baselineOriginY.
Expected behavior
The difference in baselineOriginY is more consitently scaled with the font size used. And never has the same value as the previous any of the previous lines.
Screenshots
Non-fractional baselineOriginY (I printed them all and they were always integers)
RenderDoc.2025.01.12.-.00.56.29.04.mp4
And some lines do not even get a different baselineOriginY:
RenderDoc.2025.01.12.-.00.56.49.05.mp4
NuGet package version
None
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered:
timeester3648
changed the title
DWriteCore inconsistent/wrong line spacing
DWriteCore inconsistent/wrong/non-fractional line spacing
Jan 12, 2025
Describe the bug
The line spacing between new lines in a DWriteCore text layout are not consistent or fractional. On smaller font sizes this becomes a noticable issue. Since it is a bit harder to show due to the small sizes in the TextRendering sample, I use my own application. This is at a point size of 72, and then scaled down to fit on the screen. The lines here seem mostly even.
However, if I use a point size of 3, you can start seeing the difference in line spacing:
and even more extreme, point size 0.5:
some new lines do not even give a different value compared to the previous line's
baselineOriginY
inIDWriteTextRenderer1::DrawGlyphRun
.This is most likely due to the fact that the difference in
baselineOriginY
do not properly scale with font size, as can be seen in the attached videos.Steps to reproduce the bug
baselineOriginY
becomes an issue.baselineOriginY
.Expected behavior
The difference in
baselineOriginY
is more consitently scaled with the font size used. And never has the same value as the previous any of the previous lines.Screenshots
Non-fractional
baselineOriginY
(I printed them all and they were always integers)RenderDoc.2025.01.12.-.00.56.29.04.mp4
And some lines do not even get a different
baselineOriginY
:RenderDoc.2025.01.12.-.00.56.49.05.mp4
NuGet package version
None
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: