set guifont=*

465 views
Skip to first unread message

qfwfq

unread,
May 28, 2012, 8:16:02 AM5/28/12
to v...@vim.org
Hi,

I installed vim on my unix system but when i try to run gvim it gives me the
warning:

Warning: Missing charsets in String to FontSet conversion

I tried:

set guifont=*

but no font can be used apart from the ugly one that is loaded by default.
I installed vim with the --enable-gui option on but nothing changes.

Thanks for the answers.

--
View this message in context: http://vim.1045645.n5.nabble.com/set-guifont-tp5708608.html
Sent from the Vim - General mailing list archive at Nabble.com.

Tony Mechelynck

unread,
May 28, 2012, 5:33:30 PM5/28/12
to vim...@googlegroups.com, qfwfq
Well, maybe Vim cannot find the installed fonts, or maybe (for GUI
flavours other than GTK2) your "ugly default" font is the only one whose
Properties include monospace.

Which GUI flavour you got can be found from somewhere near the top of
the :version output: for instance, in gvim I see

[...]
Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
[...]

Of course, the :set guifont= command will only change the font if you
are running in GUI mode (gvim, or vim -g, or after issuing the :gui
command successfully). In console mode, a GUI-enabled Vim will accept
the command and remember the operand, but the console font can only be
changed by the console terminal (xterm etc.), or, for some consoles, not
at all.


Best regards,
Tony.
--
Back up my hard drive? I can't find the reverse switch!

qfwfq

unread,
May 29, 2012, 3:29:34 AM5/29/12
to v...@vim.org
Thank for your reply!

>>> Which GUI flavour you got can be found from somewhere near the top of
>>> the :version output: for instance, in gvim I see:

Normal version with X11-Motif GUI. Features included (+) or not (-):

>>> the console font can only be changed by the console terminal (xterm
>>> etc.), or, for some consoles, not
at all.

In fact I can change the font only after I open gvim. I tried to set the
font in the .gvimrc but it didn't work.
I'll dig into X11-Motif GUI documentation to try to find a solution.
Thanks!

--
View this message in context: http://vim.1045645.n5.nabble.com/set-guifont-tp5708608p5708622.html

Ben Fritz

unread,
May 29, 2012, 11:03:57 PM5/29/12
to vim...@googlegroups.com, v...@vim.org
On Tuesday, May 29, 2012 2:29:34 AM UTC-5, qfwfq wrote:
>
> In fact I can change the font only after I open gvim.

Yes, this is the only way :set guifont=* will ever work. Did you try that in your .vimrc?

> I tried to set the
> font in the .gvimrc but it didn't work.

What did you try to set it to? The easy way to figure out what will work is to first use :set guifont=*, select the desired font, then :set guifont? to see what it actually got set to.

Ben Fritz

unread,
May 29, 2012, 11:05:04 PM5/29/12
to vim...@googlegroups.com, v...@vim.org

Dominique Pellé

unread,
May 29, 2012, 11:33:08 PM5/29/12
to vim...@googlegroups.com
qfwfq <verand...@gmail.com> wrote:

>
> Thank for your reply!
>
> >>> Which GUI flavour you got can be found from somewhere near the top of
> >>> the :version output: for instance, in gvim I see:
>
> Normal version with X11-Motif GUI.  Features included (+) or not (-):
>
> >>> the console font can only be changed by the console terminal (xterm
> >>> etc.), or, for some consoles, not
> at all.
>
> In fact I can change the font only after I open gvim. I tried to set the
> font in the .gvimrc but it didn't work.
> I'll dig into X11-Motif GUI documentation to try to find a solution.
> Thanks!

Did you pick a font which is listed by "xlsfonts"?

Anyway, using the gtk2 GUI is preferable if you can.
The X11-Motif GUI does not support Unicode among other things.

Regards
-- Dominique

qfwfq

unread,
May 30, 2012, 4:57:56 AM5/30/12
to v...@vim.org

Ben Fritz wrote
>
>
> What did you try to set it to? The easy way to figure out what will work
> is to first use :set guifont=*, select the desired font, then :set
> guifont? to see what it actually got set to.
>
>

It was a mistake in how I was setting the guifont in my .gvimrc:
Now I say:

set guifont=-adobe-courier-medium-r-normal--17-120-100-100-m-100-iso8859-1

and everything works; when i :set guifont? and I get what it is supposed to
be.

Thank you.

--
View this message in context: http://vim.1045645.n5.nabble.com/set-guifont-tp5708608p5708651.html

Tony Mechelynck

unread,
Jun 1, 2012, 1:09:26 AM6/1/12
to vim...@googlegroups.com, qfwfq
The above works, yet it is still too restrictive.

:set guifont=-*-courier-medium-r-normal-*-*-120-*-*-m-*-*

might work even better (find the same base font, possibly also the
corresponding italic and/or bold fonts if defined, and also any variants
of the same font, if they exist, for other charsets than Latin1).


Best regards,
Tony.
--
Here is the problem: for many years, the Supreme Court wrestled with
the issue of pornography, until finally Associate Justice John Paul
Stevens came up with the famous quotation about how he couldn't define
pornography, but he knew it when he saw it. So for a while, the
court's policy was to have all the suspected pornography trucked to
Justice Stevens' house, where he would look it over. "Nope, this isn't
it," he'd say. "Bring some more." This went on until one morning when
his housekeeper found him trapped in the recreation room under an
enormous mound of rubberized implements, and the court had to issue a
ruling stating that it didn't know what the hell pornography was except
that it was illegal and everybody should stop badgering the court about
it because the court was going to take a nap.
-- Dave Barry, "Pornography"

qfwfq

unread,
Jun 1, 2012, 8:42:24 AM6/1/12
to v...@vim.org
Yep,

thank Tony, it works the same and it is more general.
Bye!

--
View this message in context: http://vim.1045645.n5.nabble.com/set-guifont-tp5708608p5708703.html
Reply all
Reply to author
Forward
0 new messages