Home » Questions » Computers [ Ask a new question ]

Gvim displays wrong font when set from _gvimrc, but correct font when set from menus

Gvim displays wrong font when set from _gvimrc, but correct font when set from menus

This question applies to gVim running on Windows. I have the following line in my _gvimrc

Asked by: Guest | Views: 314
Total answers/comments: 5
Guest [Entry]

This seems to be fixed in the new version of Vim. (Verified with Vim 7.3d, available here http://groups.google.com/group/vim_announce/browse_thread/thread/9e72fb17d311d535# )
Guest [Entry]

"My solution was this:

set gfn=Lucida_Sans_Typewriter_Regular:h10::cANSI

Adding the ""Regular"" to the end of the font name fixed it."
Guest [Entry]

"I am having the exact same problem. I am running Vim 7.2 on Windows XP Pro here on my office computer. I've not seen this problem before on any earlier releases of Vim for Windows, Ubuntu or Mac OS X on my home machines.

My startup setting is:

set guifont=lucida_sans_typewriter:h8::cANSI

And it comes up in italic. In the dialog raised by Edit > Select Font it is set properly.

If I simply click OK in the dialog it resets itself properly.

Oddly enough, if I switch fonts to Courier or Lucida Console the problem does not occur.

Fred Bulah
fred.bulah@barclayscapital.com
fmbulah@comcast.net"
Guest [Entry]

"I get the exact same issue as dggoldst above. adding the extra "":"" doesn't seem to do anything at all, unfortunately. There's no ""r"" or something like that to make the font regular. It'd be nice if you could see what setting the font via the ""Edit -> Select Font..."" actually sets things to. There's clearly some magic that's happening behind the scenes. Doing some more testing (removing ""set guifont"" from the _gvimrc, opening a file, typing "":set"" to see what's set, then clicking ""Edit -> Select Font..."", highlighting Lucida Sans Typewriter, clicking OK, then typing again "":set"", shows that guifont=Lucida_Sans_Typewriter:h10:cANSI)

I suspect that there might be an issue with that particular font - the default font may actually be the italics version of the font, or the ""first"" instance of the font that vim is looking for is the italicized version. My ""solution"" was to use a different font. In my case, I'm using:

set guifont=Consolas:h10:cANSI

It's not as ""nice"" a font as Lucida_Sans_Typewriter, but it's also not in italics by default.

Note that I'm using Windows XP (with SP3).

The format of the commands that dggoldst has is correct. I've tried several iterations of getting this to work. The format works fine if you use:

set guifont=Lucida_Console:h11:cANSI

or

set guifont=Lucida_Console:h11

Curiously, this used to work, and only relatively recently ""broke"". As for how recently, I can only say ""within the past month or so"". I don't know what I've updated with the machine (just run Windows Updates when they're available to keep up to date)."
Guest [Entry]

"I've got the same problem..
Try this:

set gfn=""Lucida\ Sans\ Typewriter\ 10"""