0
0
mirror of https://github.com/vim/vim.git synced 2025-08-25 19:53:53 -04:00

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 <matthewtarasov@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
matveyt 2024-12-08 10:26:51 +01:00 committed by Christian Brabandt
parent 85ee742f1e
commit ad3b6a3340
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
7 changed files with 17 additions and 9 deletions

View File

@ -41615,6 +41615,8 @@ Changed~
and removed from |defaults.vim| and removed from |defaults.vim|
- the completed word and completion type are provided when handling the - the completed word and completion type are provided when handling the
|CompleteDone| autocommand in the |v:event| dictionary |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-9.2*
Added ~ Added ~

View File

@ -160,7 +160,7 @@ static const GtkTargetEntry dnd_targets[] =
* "Monospace" is a standard font alias that should be present * "Monospace" is a standard font alias that should be present
* on all proper Pango/fontconfig installations. * on all proper Pango/fontconfig installations.
*/ */
# define DEFAULT_FONT "Monospace 10" # define DEFAULT_FONT "Monospace 12"
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
# define USE_GNOME_SESSION # define USE_GNOME_SESSION

View File

@ -2729,8 +2729,8 @@ quality_id2name(DWORD id)
} }
// The default font height in 100% scaling (96dpi). // The default font height in 100% scaling (96dpi).
// (-12 in 96dpi equates to roughly 9pt) // (-16 in 96dpi equates to roughly 12pt)
#define DEFAULT_FONT_HEIGHT (-12) #define DEFAULT_FONT_HEIGHT (-16)
static const LOGFONTW s_lfDefault = static const LOGFONTW s_lfDefault =
{ {

View File

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

View 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\)' let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)'
call assert_match(pat, fname) call assert_match(pat, fname)
elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
" 'expected' is DEFAULT_FONT of gui_gtk_x11.c. " 'expected' is DEFAULT_FONT of gui_gtk_x11.c (any size)
call assert_equal('Monospace 10', fname) call assert_match('^Monospace\>', fname)
endif endif
endfunc endfunc
@ -426,7 +426,7 @@ func Test_set_guifont()
" Empty list. Should fallback to the built-in default. " Empty list. Should fallback to the built-in default.
set guifont= set guifont=
call assert_equal('Monospace 10', getfontname()) call assert_match('^Monospace\>', getfontname())
endif endif
if has('xfontset') if has('xfontset')
@ -613,7 +613,7 @@ func Test_expand_guifont()
" Test recalling default and existing option " Test recalling default and existing option
set guifont= 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 set guifont=Monospace\ 9
call assert_equal('Monospace\ 9', getcompletion('set guifont=', 'cmdline')[0]) call assert_equal('Monospace\ 9', getcompletion('set guifont=', 'cmdline')[0])

View File

@ -781,8 +781,8 @@ func Test_1_highlight_Normalgroup_exists()
if !has('gui_running') if !has('gui_running')
call assert_match('hi Normal\s*clear', hlNormal) call assert_match('hi Normal\s*clear', hlNormal)
elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
" expect is DEFAULT_FONT of gui_gtk_x11.c " expect is DEFAULT_FONT of gui_gtk_x11.c (any size)
call assert_match('hi Normal\s*font=Monospace 10', hlNormal) call assert_match('hi Normal\s*font=Monospace\>', hlNormal)
elseif has('gui_motif') elseif has('gui_motif')
" expect is DEFAULT_FONT of gui_x11.c " expect is DEFAULT_FONT of gui_x11.c
call assert_match('hi Normal\s*font=7x13', hlNormal) call assert_match('hi Normal\s*font=7x13', hlNormal)

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
915,
/**/ /**/
914, 914,
/**/ /**/