]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0915: GVim: default font size a bit too small v9.1.0915
authormatveyt <matthewtarasov@yandex.ru>
Sun, 8 Dec 2024 09:26:51 +0000 (10:26 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 8 Dec 2024 09:26:51 +0000 (10:26 +0100)
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 <matthewtarasov@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/gui_gtk_x11.c
src/os_mswin.c
src/testdir/runtest.vim
src/testdir/test_gui.vim
src/testdir/test_highlight.vim
src/version.c

index 312a1c23e7ac5df671691598c61c8e36b117ea7a..76911425c5d4605b9b2f8542491b3d90615adc07 100644 (file)
@@ -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 ~
index 6c97d1a196ee82af79f897100b4034fbd4af89c2..c037702ad9c7c210aa8848472fb6bc15ad3ffc38 100644 (file)
@@ -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
index 95e3cbcb91eed102a87d1afde40a048b2c0c73b6..485ee20afc084d1b0cf18c9b52012d2ef695e8d1 100644 (file)
@@ -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 =
 {
index ded31975b80ba7a76a0a25bb898d3260cf87384c..6fc0dcc669987f4f3d1a71cd26997984905590c4 100644 (file)
@@ -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
 
index ae65310627014155e771ea1a3446abbaf5a129a1..29259345c3666b173ea9afe14da7a4a148dca553 100644 (file)
@@ -105,8 +105,8 @@ func Test_getfontname_without_arg()
     let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)'
     call assert_match(pat, fname)
   elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
-    " 'expected' is DEFAULT_FONT of gui_gtk_x11.c.
-    call assert_equal('Monospace 10', fname)
+    " 'expected' is DEFAULT_FONT of gui_gtk_x11.c (any size)
+    call assert_match('^Monospace\>', fname)
   endif
 endfunc
 
@@ -426,7 +426,7 @@ func Test_set_guifont()
 
     " Empty list. Should fallback to the built-in default.
     set guifont=
-    call assert_equal('Monospace 10', getfontname())
+    call assert_match('^Monospace\>', getfontname())
   endif
 
   if has('xfontset')
@@ -613,7 +613,7 @@ func Test_expand_guifont()
 
     " Test recalling default and existing option
     set guifont=
-    call assert_equal('Monospace\ 10', getcompletion('set guifont=', 'cmdline')[0])
+    call assert_match('^Monospace\>', getcompletion('set guifont=', 'cmdline')[0])
     set guifont=Monospace\ 9
     call assert_equal('Monospace\ 9', getcompletion('set guifont=', 'cmdline')[0])
 
index 9bc5f12455d63f7a27e93b1c38e0ad104b58b9e3..5189b618cfe2558c29fdfc6d3f3dcb56e038f4f7 100644 (file)
@@ -781,8 +781,8 @@ func Test_1_highlight_Normalgroup_exists()
   if !has('gui_running')
     call assert_match('hi Normal\s*clear', hlNormal)
   elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
-    " expect is DEFAULT_FONT of gui_gtk_x11.c
-    call assert_match('hi Normal\s*font=Monospace 10', hlNormal)
+    " expect is DEFAULT_FONT of gui_gtk_x11.c (any size)
+    call assert_match('hi Normal\s*font=Monospace\>', hlNormal)
   elseif has('gui_motif')
     " expect is DEFAULT_FONT of gui_x11.c
     call assert_match('hi Normal\s*font=7x13', hlNormal)
index 1ae3f53369d97a2678c7d6656ef48ad89dbbd815..07bb851f1b873af3ebd9ffaa09e8fd721b3520d2 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    915,
 /**/
     914,
 /**/