How to compile with guifont ?

26 views
Skip to first unread message

Timothy Madden

unread,
Nov 30, 2009, 8:59:37 AM11/30/09
to vim...@googlegroups.com
Hello

I compiled vim on a debian server and installed in in my home folder (~/usr/local),
but the resulting executable can see no fonts when I press Tab on
   :set guifont=<Tab>
and the default font is looking too condensed. The Edit menu has no GUI Font entry.

I use ssh -Y to run gvim on my local desktop (with Ubuntu 9.10).

fc-list shows many, many
fonts installed (also locally in my home folder) on the server, and the desktop machine also
has a GUI desktop with all the fonts.

My :version is
:version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Nov 27 2009 14:45:34)
Compiled by adr...@web3.storm.lan
Normal version with X11-Athena GUI.  Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope
+cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork() -gettext
-hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape -mouse_dec
-mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile
 -python +quickfix +reltime -rightleft -ruby +scrollbind -signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11
+xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/home/adrianc/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA   -I/home/adrianc/usr/include -I/home/adrianc/usr/local/include -I/home/adrianc/usr/Trolltech/Qt-4.5.3/include -I
/home/adrianc/include  -I/home/adrianc/usr/local/include -I/home/adrianc/usr/Trolltech/Qt-4.5.3/include -I/home/adrianc/usr/local/include/gstreamer-0.10  -I/home/adrianc/usr/local
/include -I/home/adrianc/usr/Trolltech/Qt-4.5.3/include -I/home/adrianc/usr/local/include/gstreamer-0.10  -I/home/adrianc/usr/local/include -I/home/adrianc/usr/Trolltech/Qt-4.5.3/
include -I/home/adrianc/usr/local/include/gstreamer-0.10   -march=native -mtune=native -mmmx -msse -msse2 -msse3 -mcx16 -mfpmath=sse -O3 -march=native -mtune=native -mmmx -msse -m
sse2 -msse3 -mcx16 -mfpmath=sse -O3 -march=native -mtune=native -mmmx -msse -msse2 -msse3 -mcx16 -mfpmath=sse -O3
Linking: gcc   -L/home/adrianc/usr/local/lib -L/home/adrianc/usr/lib -L/home/adrianc/lib -L/home/adrianc/usr/Trolltech/Qt-4.5.3/lib -L/home/adrianc/usr/local/lib/gstreamer-0.10  -
L/home/adrianc/usr/local/lib -L/home/adrianc/usr/Trolltech/Qt-4.5.3/lib -L/home/adrianc/usr/local/lib/gstreamer-0.10  -L/home/adrianc/usr/local/lib -L/home/adrianc/usr/Trolltech/Q
t-4.5.3/lib -L/home/adrianc/usr/local/lib/gstreamer-0.10  -L/home/adrianc/usr/local/lib -L/home/adrianc/usr/Trolltech/Qt-4.5.3/lib -L/home/adrianc/usr/local/lib/gstreamer-0.10  -L
/usr/local/lib -o vim -lXaw -lXext -lm -lncurses -liconv
Press ENTER or type command to continue


Do you know what can I do to get fonts with my vim  ?

Thank you,
Adrian Constantin

Andrey Voropaev

unread,
Dec 1, 2009, 3:35:48 AM12/1/09
to vim...@googlegroups.com
On Mon, Nov 30, 2009 at 2:59 PM, Timothy Madden <termin...@gmail.com> wrote:
> I compiled vim on a debian server and installed in in my home folder
> (~/usr/local),
> but the resulting executable can see no fonts when I press Tab on
>    :set guifont=<Tab>
> and the default font is looking too condensed. The Edit menu has no GUI Font
> entry.

Are you sure that this feature shall work? At least it does not work
for me, though I can set the fonts. If I hit tab, then I get the
font that I've specified in .gvimrc and hitting <Tab> again just
produces tab character in the font name. Try to use the menu available
in gvim. There you can select the font from the list.

HTH

Andrei Voropaev

Mikael Eriksson

unread,
Dec 1, 2009, 6:34:56 AM12/1/09
to vim...@googlegroups.com
On Mon, Nov 30, 2009 at 03:59:37PM +0200, Timothy Madden wrote:
> Hello
>
> I compiled vim on a debian server and installed in in my home folder
> (~/usr/local),
> but the resulting executable can see no fonts when I press Tab on
> :set guifont=<Tab>

That doen't work i think, but you can use
:set guifont=*
to get a nice font selection dialog.

Timothy Madden

unread,
Dec 2, 2009, 8:27:46 AM12/2/09
to vim_use
:set guifont=*

Works on Win32, GTK, Mac OS and Photon. Looks like I have none of
these.
Thank you for the answers. I think I have to leave this problem as it
is for
now ...

Thank you,
Timothy Madden

Matt Wozniski

unread,
Dec 14, 2009, 1:52:21 AM12/14/09
to vim...@googlegroups.com
On Wed, Dec 2, 2009 at 8:27 AM, Timothy Madden wrote:
> :set guifont=*
>
> Works on Win32, GTK, Mac OS and Photon. Looks like I have none of
> these.
> Thank you for the answers. I think I have to leave this problem as it
> is for
> now ...

It also works fine for my gvim, which is X11-Motif... I'd be really
surprised if it doesn't work with X11-Athena...

~Matt

pansz

unread,
Dec 14, 2009, 9:05:38 PM12/14/09
to vim...@googlegroups.com
Timothy Madden 写道:
> Hello
>
> I compiled vim on a debian server and installed in in my home folder
> (~/usr/local),
> but the resulting executable can see no fonts when I press Tab on
> :set guifont=<Tab>
> and the default font is looking too condensed. The Edit menu has no GUI Font
> entry.

X11-Athena is the fallback when no other gui toolkit found, perhaps all
you need is the gtk-dev related dependency. with a full-featured gtk
version you will be able to set gui font.

simply run the following to install the dependencies:

sudo apt-get build-dep vim

then configure your vim and make. that should work for your debian.

try it.

Tony Mechelynck

unread,
Dec 31, 2009, 11:50:04 PM12/31/09
to vim...@googlegroups.com, Timothy Madden
On 30/11/09 14:59, Timothy Madden wrote:
> Hello
>
> I compiled vim on a debian server and installed in in my home folder
> (~/usr/local),
> but the resulting executable can see no fonts when I press Tab on
> :set guifont=<Tab>
> and the default font is looking too condensed. The Edit menu has no GUI
> Font entry.
>
> I use ssh -Y to run gvim on my local desktop (with Ubuntu 9.10).
>
> fc-list shows many, many
> fonts installed (also locally in my home folder) on the server, and the
> desktop machine also
> has a GUI desktop with all the fonts.
>
> My :version is
> :version
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Nov 27 2009 14:45:34)
> Compiled by adr...@web3.storm.lan
> Normal version with X11-Athena GUI. Features included (+) or not (-):
[...]

Any Vim GUI can set the font; the problem is that only some of them (not
including yours, apparently) can tell you from which fonts it is
possible to choose. So you'll have to guess.

If you have the LucidaTypewriter font installed (on the computer where
gvim is running), you might try

:set gfn=-*-lucidatypewriter-medium-r-normal-*-*-90-*-*-m-*-*

or else, if you have a Courier font installed there, you might try

:set gfn=-*-courier-medium-r-normal-*-*-90-*-*-m-*-*

(where 90 is the size, in tenths of point I think: the larger the
number, the bigger the font). Similarly for other font faces: I'm just
mentioning these two because they are fairly common, so there's a
substantial chance that you've got them. The -m- near the end is
essential: it means "monotype" (i.e. fixed-width); Vim won't use any
other kind of font (except on GTK2, where other kinds look ugly anyway).

Note that if in the meantime you have installed a GTK2 version of Vim,
the above settings won't work (but GTK2 gvim has the nice ":set gfn=*"
menu, so this whole discussion is moot in that case).

For more details, including how to set the font in a vimrc which is to
be used on various versions of gvim and possibly on various OSes, see
http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI


Best regards,
Tony.
--
To understand this important story, you have to understand how the
telephone company works. Your telephone is connected to a local
computer, which is in turn connected to a regional computer, which is
in turn connected to a loudspeaker the size of a garbage truck on the
lawn of Edna A. Bargewater of Lawrence, Kan.

Whenever you talk on the phone, your local computer listens in. If it
suspects you're going to discuss an intimate topic, it notifies the
computer above it, which listens in and decides whether to alert the
one above it, until finally, if you really humiliate yourself, maybe
break down in tears and tell your closest friend about a sordid
incident from your past involving a seedy motel, a neighbor's spouse,
an entire religious order, a garden hose and six quarts of tapioca
pudding, the top computer feeds your conversation into Edna's
loudspeaker, and she and her friends come out on the porch to listen
and drink gin and laugh themselves silly.
-- Dave Barry, "Won't It Be Just Great Owning Our Own
Phones?"

Dominique Pellé

unread,
Jan 1, 2010, 5:42:37 AM1/1/10
to vim...@googlegroups.com
Matt Wozniski wrote:


":help 'guifont'" says...
======================================
For Win32, GTK, Mac OS and Photon: >
:set guifont=*
< will bring up a font requester, where you can pick the font you want.
======================================

... which implicitly means that ":set guifont=*" is not possible for
Athena GUI. And "set guifont=*" does not work indeed with Athena
GUI. It gives:

E236: Font "*" is not fixed-width
E596: Invalid font(s): guifont=*

Motif is not listed either, but doing ":guifont=*" with Motif does
bring a popup window to chose the font. So I think Motif should
be listed in the help page:

$ diff -c options.txt.orig options.txt
*** options.txt.orig 2010-01-01 11:39:25.502514991 +0100
--- options.txt 2010-01-01 11:39:31.377465863 +0100
***************
*** 3250,3256 ****
the case of X). The font names given should be "normal" fonts. Vim
will try to find the related bold and italic fonts.

! For Win32, GTK, Mac OS and Photon: >
:set guifont=*
< will bring up a font requester, where you can pick the font you want.

--- 3250,3256 ----
the case of X). The font names given should be "normal" fonts. Vim
will try to find the related bold and italic fonts.

! For Win32, GTK, Motif, Mac OS and Photon: >
:set guifont=*
< will bring up a font requester, where you can pick the font you want.

-- Dominique

Bram Moolenaar

unread,
Jan 6, 2010, 11:41:48 AM1/6/10
to Dominique Pellé, vim...@googlegroups.com

Dominique Pelle wrote:

I'll change it, thanks.

--
From "know your smileys":
O:-) Saint

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages