Commit: patch 9.1.0915: GVim: default font size a bit too small

5 views
Skip to first unread message

Christian Brabandt

unread,
Dec 8, 2024, 4:30:13 AM12/8/24
to vim...@googlegroups.com
patch 9.1.0915: GVim: default font size a bit too small

Commit: https://github.com/vim/vim/commit/ad3b6a3340a4ab02c1e5bc4a6d6a5fb858b671d3
Author: matveyt <matthew...@yandex.ru>
Date: Sun Dec 8 10:26:51 2024 +0100

patch 9.1.0915: GVim: default font size a bit too small

Problem: GVim: default font size a bit too small
Solution: increase guifont size to 12 pt on GTK builds
of gVim (matveyt).

fixes: #16172
closes: #16178

Signed-off-by: matveyt <matthew...@yandex.ru>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 312a1c23e..76911425c 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -41615,6 +41615,8 @@ Changed~
and removed from |defaults.vim|
- the completed word and completion type are provided when handling the
|CompleteDone| autocommand in the |v:event| dictionary
+- the default fontsize for the GTK builds of Vim (Windows and Unix) has been
+ increased to 12pt to accomodate modern high-dpi monitors

*added-9.2*
Added ~
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 6c97d1a19..c037702ad 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -160,7 +160,7 @@ static const GtkTargetEntry dnd_targets[] =
* "Monospace" is a standard font alias that should be present
* on all proper Pango/fontconfig installations.
*/
-# define DEFAULT_FONT "Monospace 10"
+# define DEFAULT_FONT "Monospace 12"

#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
# define USE_GNOME_SESSION
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 95e3cbcb9..485ee20af 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2729,8 +2729,8 @@ quality_id2name(DWORD id)
}

// The default font height in 100% scaling (96dpi).
-// (-12 in 96dpi equates to roughly 9pt)
-#define DEFAULT_FONT_HEIGHT (-12)
+// (-16 in 96dpi equates to roughly 12pt)
+#define DEFAULT_FONT_HEIGHT (-16)

static const LOGFONTW s_lfDefault =
{
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index ded31975b..6fc0dcc66 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -55,6 +55,10 @@ silent! endwhile

" In the GUI we can always change the screen size.
if has('gui_running')
+ if has('gui_gtk')
+ " to keep screendump size unchanged
+ set guifont=Monospace\ 10
+ endif
set columns=80 lines=25
endif

diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index ae6531062..29259345c 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -105,8 +105,8 @@ func Test_getfontname_without_arg()
let pat = '\(7x13\)\|\(
Reply all
Reply to author
Forward
0 new messages