After the DirectX rendering improvements in patch 9.1.2125 (commit b39b065), users reported that fonts rendered with DirectX (set renderoptions=type:directx) appeared smaller than the same fonts rendered with GDI.
The original DirectX implementation (before patch 9.1.2125) had a clipping issue: The ETO_CLIPPED flag and clipping rectangle (lprc) passed from the GDI layer were not being respected. Without proper clipping, glyphs would extend beyond cell boundaries, causing rendering artifacts (visual "garbage") above and below the text cells.
In patch 9.1.2125, to work around this long-standing clipping issue (#19254), the font size was intentionally reduced by scaling to only the ascent height:
fontSize = ceil(fontSize * float(fontMetrics.ascent) / float(fontMetrics.designUnitsPerEm));This prevented glyphs from overflowing their cells, but it also made the fonts appear smaller than their GDI counterparts—typically about 13% smaller (e.g., 13px instead of 15px for an 11pt font).
Instead of reducing the font size to avoid overflow, this patch fixes the root cause by implementing proper clipping support:
PushAxisAlignedClip() and PopAxisAlignedClip() calls in DWriteContext::DrawText() to respect the clipping rectangleWith proper clipping in place, glyphs are prevented from rendering outside their cell boundaries, eliminating the need to artificially reduce the font size.
closes: #19254
https://github.com/vim/vim/pull/19304
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra commented on this pull request.
> @@ -1080,6 +1086,11 @@ DWriteContext::DrawText(const WCHAR *text, int len,
}
SafeRelease(&textLayout);
+
+ if ((fuOptions & ETO_CLIPPED) && lprc != NULL)
+ {
you can drop the braces here
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Unicode Box (vertical) characters are now have gaps
directx enabled
image.png (view on web)directx disabled and before this patch
image.png (view on web)—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@habamax Could you please show me part of your vimrc to reproduce it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@habamax Could you please show me part of your vimrc to reproduce it.
set fillchars=vert:│
set renderoptions=type:directx
set linespace=0
set guifont=:h17
image.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hmm, font related issue?
image.png (view on web)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()