Commit: patch 9.2.0965: GTK4: blurry text rendering
Christian Brabandt <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <[email protected]> |
patch 9.2.0965: GTK4: blurry text rendering Commit: https://github.com/vim/vim/commit/5a0e4889d185dd2cb9c3c7049b726160393ef7c6 Author: Christoffer Aasted <[email protected]> Date: Mon Aug 17 20:49:08 2026 +0000 patch 9.2.0965: GTK4: blurry text rendering Problem: The GTK4 GUI rounds the character width up instead of to the nearest pixel, and adjacent row nodes leave a one pixel seam because their boundaries are not snapped to device pixels. Solution: Round the character width to the nearest pixel and overlap adjacent row nodes by one pixel (Christoffer Aasted). closes: #21013 Signed-off-by: Christoffer Aasted <[email protected]> Signed-off-by: Foxe Chen <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c index 5b31e587b..90e3e8603 100644 --- a/src/gui_gtk4.c +++ b/src/gui_gtk4.c @@ -1303,7 +1303,7 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED) pango_layout_get_size(layout, &width, NULL); g_object_unref(layout); - gui.char_width = (width / 2 + PANGO_SCALE - 1) / PANGO_SCALE; + gui.char_width = (width / 2 + PANGO_SCALE / 2) / PANGO_SCALE; if (gui.char_width <= 0) gui.char_width = 8; diff --git a/src/gui_gtk4_da.c b/src/gui_gtk4_da.c index d7e460254..6eb9798e2 100644 --- a/src/gui_gtk4_da.c +++ b/src/gui_gtk4_da.c @@ -694,8 +694,8 @@ draw_layer_get_texture( // Scale texture to actual size node = gsk_texture_scale_node_new(texture, - &GRAPHENE_RECT_INIT(FILL_X(0), FILL_Y(row), - (da->n_cols + bleed) * gui.char_width, gui.char_height), + &GRAPHENE_RECT_INIT(FILL_X(0), FILL_Y(row), + (da->n_cols + bleed) * gui.char_width, gui.char_height + bleed), GSK_SCALING_FILTER_NEAREST); if (bleed) { @@ -704,7 +704,7 @@ draw_layer_get_texture( new = gsk_clip_node_new(node, &GRAPHENE_RECT_INIT(FILL_X(0), FILL_Y(row), da->n_cols * gui.char_width + da->bleed_right, - gui.char_height)); + gui.char_height + 1)); gsk_render_node_unref(node); node = new; } diff --git a/src/version.c b/src/version.c index bd636ef46..ae56e26a8 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 965, /**/ 964, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1ww4RA-00949P-Kp%40256bit.org.