comparison runtime/doc/gui.txt @ 16439:9d20e26dc13c v8.1.1224

patch 8.1.1224: MS-Windows: cannot specify font weight commit https://github.com/vim/vim/commit/f720d0a77e393990b2171a77210565bdc82064f2 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 28 14:02:47 2019 +0200 patch 8.1.1224: MS-Windows: cannot specify font weight Problem: MS-Windows: cannot specify font weight. Solution: Add the "W" option to 'guifont'. (closes https://github.com/vim/vim/issues/4309) Move GUI font explanation out of options.txt.
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Apr 2019 14:15:06 +0200
parents 6012cc6936f7
children 0e473e9e70c2
comparison
equal deleted inserted replaced
16438:6b1f87294f4f 16439:9d20e26dc13c
1 *gui.txt* For Vim version 8.1. Last change: 2019 Jan 06 1 *gui.txt* For Vim version 8.1. Last change: 2019 Apr 28
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
9 1. Starting the GUI |gui-start| 9 1. Starting the GUI |gui-start|
10 2. Scrollbars |gui-scrollbars| 10 2. Scrollbars |gui-scrollbars|
11 3. Mouse Control |gui-mouse| 11 3. Mouse Control |gui-mouse|
12 4. Making GUI Selections |gui-selections| 12 4. Making GUI Selections |gui-selections|
13 5. Menus |menus| 13 5. Menus |menus|
14 6. Extras |gui-extras| 14 6. Font |gui-font|
15 7. Shell Commands |gui-shell| 15 7. Extras |gui-extras|
16 8. Shell Commands |gui-shell|
16 17
17 Other GUI documentation: 18 Other GUI documentation:
18 |gui_x11.txt| For specific items of the X11 GUI. 19 |gui_x11.txt| For specific items of the X11 GUI.
19 |gui_w32.txt| For specific items of the Win32 GUI. 20 |gui_w32.txt| For specific items of the Win32 GUI.
20 21
1035 make a selection. 1036 make a selection.
1036 1037
1037 Note that a menu that starts with ']' will not be displayed. 1038 Note that a menu that starts with ']' will not be displayed.
1038 1039
1039 ============================================================================== 1040 ==============================================================================
1040 6. Extras *gui-extras* 1041 6. Font
1042
1043 This section describes font related options.
1044
1045 GUIFONT *gui-font*
1046
1047 'guifont' is the option that tells Vim what font to use. In its simplest form
1048 the value is just one font name. It can also be a list of font names
1049 separated with commas. The first valid font is used. When no valid font can
1050 be found you will get an error message.
1051
1052 On systems where 'guifontset' is supported (X11) and 'guifontset' is not
1053 empty, then 'guifont' is not used. See |xfontset|.
1054
1055 Note: As to the GTK GUIs, no error is given against any invalid names, and the
1056 first element of the list is always picked up and made use of. This is
1057 because, instead of identifying a given name with a font, the GTK GUIs use it
1058 to construct a pattern and try to look up a font which best matches the
1059 pattern among available fonts, and this way, the matching never fails. An
1060 invalid name doesn't matter because a number of font properties other than
1061 name will do to get the matching done.
1062
1063 Spaces after a comma are ignored. To include a comma in a font name precede
1064 it with a backslash. Setting an option requires an extra backslash before a
1065 space and a backslash. See also |option-backslash|. For example: >
1066 :set guifont=Screen15,\ 7x13,font\\,with\\,commas
1067 will make Vim try to use the font "Screen15" first, and if it fails it will
1068 try to use "7x13" and then "font,with,commas" instead.
1069
1070 If none of the fonts can be loaded, Vim will keep the current setting. If an
1071 empty font list is given, Vim will try using other resource settings (for X,
1072 it will use the Vim.font resource), and finally it will try some builtin
1073 default which should always be there ("7x13" in the case of X). The font
1074 names given should be "normal" fonts. Vim will try to find the related bold
1075 and italic fonts.
1076
1077 For Win32, GTK, Motif, Mac OS and Photon: >
1078 :set guifont=*
1079 will bring up a font requester, where you can pick the font you want.
1080
1081 The font name depends on the GUI used. See |setting-guifont| for a way to set
1082 'guifont' for various systems.
1083
1084 For the GTK+ 2 and 3 GUIs, the font name looks like this: >
1085 :set guifont=Andale\ Mono\ 11
1086 That's all. XLFDs are not used. For Chinese this is reported to work well: >
1087 if has("gui_gtk2")
1088 set guifont=Bitstream\ Vera\ Sans\ Mono\ 12,Fixed\ 12
1089 set guifontwide=Microsoft\ Yahei\ 12,WenQuanYi\ Zen\ Hei\ 12
1090 endif
1091 <
1092 (Replace gui_gtk2 with gui_gtk3 for the GTK+ 3 GUI)
1093
1094 For Mac OSX you can use something like this: >
1095 :set guifont=Monaco:h10
1096 Also see 'macatsui', it can help fix display problems.
1097 *E236*
1098 Note that the fonts must be mono-spaced (all characters have the same width).
1099 An exception is GTK: all fonts are accepted, but mono-spaced fonts look best.
1100
1101 To preview a font on X11, you might be able to use the "xfontsel" program.
1102 The "xlsfonts" program gives a list of all available fonts.
1103
1104 For the Win32 GUI *E244* *E245*
1105 - Takes these options in the font name (use a ':' to separate the options):
1106 hXX - height is XX (points, can be floating-point)
1107 wXX - width is XX (points, can be floating-point)
1108 WXX - weight is XX (see Note on Weights below)
1109 b - bold. This is equivalent to setting the weight to 700.
1110 i - italic
1111 u - underline
1112 s - strikeout
1113 cXX - character set XX. Valid charsets are: ANSI, ARABIC, BALTIC,
1114 CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, HANGEUL,
1115 HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, SYMBOL, THAI,
1116 TURKISH, VIETNAMESE ANSI and BALTIC. Normally you would use
1117 "cDEFAULT".
1118 qXX - quality XX. Valid quality names are: PROOF, DRAFT, ANTIALIASED,
1119 NONANTIALIASED, CLEARTYPE, DEFAULT. Normally you would use
1120 "qDEFAULT".
1121 Some quality values are not supported in legacy OSs.
1122 - A '_' can be used in the place of a space, so you don't need to use
1123 backslashes to escape the spaces.
1124 Examples: >
1125 :set guifont=courier_new:h12:w5:b:cRUSSIAN
1126 :set guifont=Andale_Mono:h7.5:w4.5
1127
1128 See also |font-sizes|.
1129
1130 Note on Weights: Fonts often come with a variety of weights. "Normal" weights
1131 in Windows have a value of 400 and, left unspecified, this is the value that
1132 will be used when attempting to find fonts. Windows will often match fonts
1133 based on their weight with higher priority than the font name which means a
1134 Book or Medium variant of a font might be used despite specifying a Light or
1135 ExtraLight variant. If you are experiencing heavier weight substitution, then
1136 explicitly setting a lower weight value may mitigate against this unwanted
1137 substitution.
1138
1139
1140 GUIFONTWIDE *gui-fontwide*
1141
1142 When not empty, 'guifontwide' specifies a comma-separated list of fonts to be
1143 used for double-width characters. The first font that can be loaded is
1144 used.
1145
1146 Note: The size of these fonts must be exactly twice as wide as the one
1147 specified with 'guifont' and the same height. If there is a mismatch then
1148 the text will not be drawn correctly.
1149
1150 All GUI versions but GTK+:
1151
1152 'guifontwide' is only used when 'encoding' is set to "utf-8" and
1153 'guifontset' is empty or invalid.
1154 When 'guifont' is set and a valid font is found in it and
1155 'guifontwide' is empty Vim will attempt to find a matching
1156 double-width font and set 'guifontwide' to it.
1157
1158 GTK+ GUI only: *guifontwide_gtk*
1159
1160 If set and valid, 'guifontwide' is always used for double width
1161 characters, even if 'encoding' is not set to "utf-8".
1162 Vim does not attempt to find an appropriate value for 'guifontwide'
1163 automatically. If 'guifontwide' is empty Pango/Xft will choose the
1164 font for characters not available in 'guifont'. Thus you do not need
1165 to set 'guifontwide' at all unless you want to override the choice
1166 made by Pango/Xft.
1167
1168 Windows +multibyte only: *guifontwide_win_mbyte*
1169
1170 If set and valid, 'guifontwide' is used for IME instead of 'guifont'.
1171
1172 ==============================================================================
1173 7. Extras *gui-extras*
1041 1174
1042 This section describes other features which are related to the GUI. 1175 This section describes other features which are related to the GUI.
1043 1176
1044 - With the GUI, there is no wait for one second after hitting escape, because 1177 - With the GUI, there is no wait for one second after hitting escape, because
1045 the key codes don't start with <Esc>. 1178 the key codes don't start with <Esc>.
1079 1212
1080 A recommended Japanese font is MS Mincho. You can find info here: 1213 A recommended Japanese font is MS Mincho. You can find info here:
1081 http://www.lexikan.com/mincho.htm 1214 http://www.lexikan.com/mincho.htm
1082 1215
1083 ============================================================================== 1216 ==============================================================================
1084 7. Shell Commands *gui-shell* 1217 8. Shell Commands *gui-shell*
1085 1218
1086 For the X11 GUI the external commands are executed inside the gvim window. 1219 For the X11 GUI the external commands are executed inside the gvim window.
1087 See |gui-pty|. 1220 See |gui-pty|.
1088 1221
1089 WARNING: Executing an external command from the X11 GUI will not always 1222 WARNING: Executing an external command from the X11 GUI will not always