Strange font rendering in gVIM 7.3 in Unix

204 views
Skip to first unread message

Jerry

unread,
Dec 11, 2011, 11:42:18 PM12/11/11
to vim_use
I recently compiled a VIM 7.3 under Unix. I am using all default
options.
When opening GVIM, I found that the font rendering is really crappy.
It is entirely unacceptable when compared with VIM 7.2
Here are the screen shots for the same piece of code under two
versions. The font was set to be the same.
gVIM 7.3 screenshot: http://i.imgur.com/K2nbx.jpg
gVIM 7.2 screenshot: http://i.imgur.com/wyHdw.jpg

I did some research and know that VIM 7.3 is complied with GTK2 and
VIM 7.2 is compiled with GTK.
But I still can not figure out what went wrong.
Can somebody help me with this? Any tips are appreciated.
Thank you very much in advance.

Ivan Krasilnikov

unread,
Dec 11, 2011, 11:57:36 PM12/11/11
to vim...@googlegroups.com
On Mon, Dec 12, 2011 at 05:42, Jerry <zhiwe...@gmail.com> wrote:
> gVIM 7.3 screenshot: http://i.imgur.com/K2nbx.jpg

I see something similar when I set guifont to a non-existing font name.

Does ":set guifont=Monospace" or choosing some font through "Edit >
Select font..." menu solve your problem?

> gVIM 7.2 screenshot: http://i.imgur.com/wyHdw.jpg
>
> I did some research and know that VIM 7.3 is complied with GTK2 and
> VIM 7.2 is compiled with GTK.

Perhaps the difference could be that some fonts aren't recognized in
different gtk version. Which font are you using?

sc

unread,
Dec 12, 2011, 12:05:24 AM12/12/11
to vim...@googlegroups.com

it appears the color schemes, while similar, are different --
notice the blue literals in one and the yellow in the other

sc

Tony Mechelynck

unread,
Dec 12, 2011, 12:05:45 AM12/12/11
to vim...@googlegroups.com, Jerry

If you want gvim to use a good-looking font (and "good-looking" in
_your_ eyes), you should set the 'guifont' option in your vimrc. Beware
that this option's allowable values vary from one GUI flavour to the
next, and in particular between GTK1 (which falls under "other X11" in
the wiki page linked below) and GTK2.

See http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI


Best regards,
Tony.
--
I'm going to Iowa for an award. Then I'm appearing at Carnegie Hall,
it's sold out. Then I'm sailing to France to be honored by the French
government -- I'd give it all up for one erection.
-- Groucho Marx

John Little

unread,
Dec 12, 2011, 12:06:30 AM12/12/11
to vim_use
On Dec 12, 5:42 pm, Jerry <zhiweiw...@gmail.com> wrote:
> I recently compiled a VIM 7.3 ... font rendering is really crappy.

Your bad font looks like a proportional font used in vim. Vim with
GTK can use proportional fonts but they look like that. I suggest you
experiment with changing the font, and if you still have trouble tell
us which font it is.

Regards, John

Jerry

unread,
Dec 12, 2011, 8:47:23 PM12/12/11
to vim_use
I am using -dt-interface\ user-medium-r-normal-*-*-120-*-*-m-*-
iso8859-1
I did some research today and found out the gVIM7.3 can not load any
font I specified. And it fell back to the default font.
Do you have any idea how to fix this?
Thank you so much for replying.

On Dec 11, 10:57 pm, Ivan Krasilnikov <inf...@gmail.com> wrote:

Jerry

unread,
Dec 12, 2011, 8:48:28 PM12/12/11
to vim_use
I noticed that too. But when I tried it again, the color become the
same. Don't know what happened there.
Thanks, SC.

On Dec 11, 11:05 pm, sc <tooth...@swbell.net> wrote:
> On Mon, Dec 12, 2011 at 05:57:36AM +0100, Ivan Krasilnikov wrote:

Jerry

unread,
Dec 12, 2011, 9:24:16 PM12/12/11
to vim_use
Thank you Tony.
I was able to set the font Bitstream\ Vera\ Sans\ Mono\ 11 etc as
suggested by the wikia. but I was not able to specify the font I
wanted.
Do you know why GTK2 can only find a subset of the fonts? thanks.


On Dec 11, 11:05 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:


> On 12/12/11 05:42, Jerry wrote:
>
> > I recently compiled a VIM 7.3 under Unix. I am using all default
> > options.
> > When opening GVIM, I found that the font rendering is really crappy.
> > It is entirely unacceptable when compared with VIM 7.2
> > Here are the screen shots for the same piece of code under two
> > versions. The font was set to be the same.
> > gVIM 7.3 screenshot:http://i.imgur.com/K2nbx.jpg
> > gVIM 7.2 screenshot:http://i.imgur.com/wyHdw.jpg
>
> > I did some research and know that VIM 7.3 is complied with GTK2 and
> > VIM 7.2 is compiled with GTK.
> > But I still can not figure out what went wrong.
> > Can somebody help me with this? Any tips are appreciated.
> > Thank you very much in advance.
>
> If you want gvim to use a good-looking font (and "good-looking" in
> _your_ eyes), you should set the 'guifont' option in your vimrc. Beware
> that this option's allowable values vary from one GUI flavour to the
> next, and in particular between GTK1 (which falls under "other X11" in
> the wiki page linked below) and GTK2.
>

> Seehttp://vim.wikia.com/wiki/Setting_the_font_in_the_GUI

Jerry

unread,
Dec 12, 2011, 9:26:48 PM12/12/11
to vim_use
Thank you, John.
I was able to set guifont=Bitstream\ Vera\ Sans\ Mono\ 11. and that
looked better.
but I can not set guifont=-dt-interface\ user-medium-r-normal-*-*-120-
*-*-m-*-iso8859-1, which I liked in gVIM 7.2. Do you know why?

Tony Mechelynck

unread,
Dec 12, 2011, 9:41:51 PM12/12/11
to vim...@googlegroups.com, Jerry
On 13/12/11 03:24, Jerry wrote:
> Thank you Tony.
> I was able to set the font Bitstream\ Vera\ Sans\ Mono\ 11 etc as
> suggested by the wikia. but I was not able to specify the font I
> wanted.
> Do you know why GTK2 can only find a subset of the fonts? thanks.
>

GTK2 ought to be able to find all the fonts installed on your computer,
but it names them differently than GTK1.

Try

:set gfn=*

which will give you a dialog where you can choose any installed font as
your 'guifont'.

*Warning* In gvim with GTK2 GUI, you can select a proportional font, but
it will look ugly, with too much blank space around thin letters like i
or l, and/or too little room around thick ones like m or M, especially
if "thin" letters happen next to each other as in 'illit' or "thick"
ones as in "Hmmmm...".


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
241. You try to look for Net Search even when you're in File Manager.

Jerry

unread,
Dec 13, 2011, 12:00:22 AM12/13/11
to vim_use
Thanks a lot, Tony. I will experiment with that.
Also I noticed the color scheme is not loaded right.
With the same color scheme specified, what showed up in VIM7.2 is
different from what is showed up in VIM7.3. Like in the examples of my
first post.
Do you happen to have an idea what maybe wrong?

On Dec 12, 8:41 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

Tony Mechelynck

unread,
Dec 13, 2011, 3:53:10 AM12/13/11
to vim...@googlegroups.com, Jerry
On 13/12/11 06:00, Jerry wrote:
> Thanks a lot, Tony. I will experiment with that.
> Also I noticed the color scheme is not loaded right.
> With the same color scheme specified, what showed up in VIM7.2 is
> different from what is showed up in VIM7.3. Like in the examples of my
> first post.
> Do you happen to have an idea what maybe wrong?

No I don't.

Best regards,
Tony.

Reply all
Reply to author
Forward
0 new messages