Re: Setting up fonts for use with vim compiled with GTK-2
- Mun Johl wrote:
> Hi,GTK+2 uses a diffrent 'guifont' format than all other flavours of gvim.
> I've installed all the pieces (I think) to get GTK-2 running on my Sun
> Solaris 8 box. After doing so, I re-compiled vim7 and it seems to be
> running fine except that vim doesn't know about the fonts that I use
> most often. Specifically, the -misc-* and -adobe-* fonts.
> I looked at the help for fonts and gtk, but I wasn't able to resolve my
> issue. How can I get the gtk-2 version of vim to understand the fonts I
> use with the Motif version of vim?
> Thanks in advance.
Here's how I solve the problem in my vimrc:
set guifont=B&H\ LucidaTypewriter\ 15
set guifont=B&H\ LucidaTypewriter/15
The relevant info can be found, but not easily, in the Vim help, and
also (somewhat more easily) in a vimtip I wrote (currently the 2nd
best-rated if you search for "font"). (Obviously, the first branch of
the inner ":if" is for GTK+2, the second one for kvim, the third one for
other X11 versions, and the last one for all the rest.) (Disregard any
"beautifying linebreaks" added by my mail client or by yours.)
You may also want to use
to select from a menu, or
(assuming 'nocompatible') to have gvim add the current value (with
escaping backslashes where needed) so you can edit it /in loco/ then
accept the new value by hitting <Enter>, or abandon the changes by
hitting <Esc>. Don't forget to write the value you want (with its
escaping bacslash or backslashes) into your vimrc when you're satisfied
with how it looks.