[vim/vim] gtk4(font): (PR #21013)

3 views
Skip to first unread message

dezza

unread,
Aug 11, 2026, 4:17:30 PM (5 days ago) Aug 11
to vim/vim, Subscribed

Problem:

  • Fonts do not account for letter spacing (:help 'linespace' is what vim calls it).
  • Sign column has seams between lines.

Solution:

  • Font: Round char with nearest pixel
  • Signs: Overlap adjacent row nodes by one pixel.

c158acf round char w nearest px

c158acf Overlap adjacent row nodes by one pixel.

GSK renderer rounding seems to add 1px (not sure).

Possibly related: https://blogs.gnome.org/gtk/2026/05/28/snapping/

Fixes: #21002


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21013

Commit Summary

  • 1689be0 GTK4(font): round char w nearest px
  • c158acf GTK4(font): signcol has seams

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013@github.com>

dezza

unread,
Aug 11, 2026, 4:19:08 PM (5 days ago) Aug 11
to vim/vim, Subscribed
dezza left a comment (vim/vim#21013)

@64-bitman please check if you see anything off in your view. I think my assessment of the custom narrow letterspacing/lineheight was correct - it should not affect your font much if correct.. If you preferred old look go change settings.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5258371380@github.com>

Foxe Chen

unread,
Aug 11, 2026, 4:39:50 PM (5 days ago) Aug 11
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#21013)

I did not notice anything significant visually, so if it fixed your issue, then this looks good


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5258588984@github.com>

dezza

unread,
Aug 11, 2026, 5:00:45 PM (5 days ago) Aug 11
to vim/vim, Subscribed
dezza left a comment (vim/vim#21013)

@64-bitman I tested with some edgy set linespace=7 val and setting back again. My findings are;

  • gtk4 seems to add overall height between a total span of num of rows
    .. but otherwise the dimensions look identical I attribute to accumulating linear dpi scaling differences possibly also why my second observation cmdheight almost rounded up to a "row" of extra space in the bottom.

guioptions+=k is snapping to rows in gtk3, but not on gtk4 (freeform resize no snapping except internal shell) - possibly another issue.

Overall I think it looks proper now.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5258793493@github.com>

Foxe Chen

unread,
Aug 11, 2026, 5:02:35 PM (5 days ago) Aug 11
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#21013)

guioptions+=k is snapping to rows in gtk3, but not on gtk4 (freeform resize no snapping except internal shell) - possibly another issue.

If you are talking about resizing the window being able to snap to discrete rows, that is not possibly in GTK4 (nor Wayland if I belive as of now).


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5258812266@github.com>

Christian Brabandt

unread,
Aug 13, 2026, 3:14:37 PM (3 days ago) Aug 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21013)

@64-bitman okay with you?

I don't quite understand the code, so if it fixes the blurry rendering then it is fine with me. But one thing I don't follow: according to the comment bleed means to extend by one cell to the right, but you are now adding bleed also to the height? But those are two unrelated things, no?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5285268556@github.com>

Foxe Chen

unread,
Aug 13, 2026, 3:18:23 PM (3 days ago) Aug 13
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#21013)

@64-bitman okay with you?

I don't quite understand the code, so if it fixes the blurry rendering then it is fine with me. But one thing I don't follow: according to the comment bleed means to extend by one cell to the right, but you are now adding bleed also to the height? But those are two unrelated things, no?

All it does is make it so that the background of the bottommost row can bleed downwards. So its unrelated to what this PR is trying fix. However I may be wrong. @dezza is it necessary to fix your issue? Thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5285306439@github.com>

dezza

unread,
Aug 13, 2026, 5:52:35 PM (3 days ago) Aug 13
to vim/vim, Subscribed
dezza left a comment (vim/vim#21013)

@chrisbra
Font:
Old code rounded up by default, causing extra spacing. New rounds to nearest pixel, avoiding extra spacing between letters and respects font defaults.

Signcol:
short: gtk4.24 introduce snapping to grid, addresses issues exactly like these as confirmed by one of the leading maintainers.

My fix shifts it a single logical unit (its not px, it maps to the devices scaling).


#21043 added as reminder for GTK4.24


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21013/c5286809896@github.com>

Reply all
Reply to author
Forward
0 new messages