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

set guifont=Lucida_Sans_Typewriter:h11:cANSI

When gVim starts up, it strange italicizes everything!

A call to :set guifont shows that things seem to have been set correctly, as it returns


Then I manually select Edit->Select Font ... and then choose Lucida Sans Typewriter, and font size 11 and submit, the italics disappear and it looks fine.

I've posted my _gvimrc for reference at http://vim.pastey.net/132157

So my questions are:

  1. Why am I getting different results from setting it manually and from _gvimrc?
  2. Is there a way to capture the command that the dialog box is sending back to the program? It might include extra commands that I'm missing.

Here is something I would suggest if you can do it. If you can get view the GVim on the system desktop then go to set the font that you want it at then do a:

:set gfn

This will show you the font you currently have GVim set to. Open you .vimrc file in your home directory (Ubuntu) and add the following line:

set gfn="Courier\ 10\ Pitch\ 10" # what mine is set to.

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# )

  • I have gVim 7.4 installed and I still have the Italic font problem. – Carlos Calla Apr 8 '15 at 14:46

My solution was this:

set gfn=Lucida_Sans_Typewriter_Regular:h10::cANSI

Adding the "Regular" to the end of the font name fixed it.


Are you sure you've set that properly in your _gvimrc? I see this line:

"""Display and Sound""" 
"Set Fonts and colors 
colorscheme evening 
set gfn=Lucida_Sans_Typewriter:h10

... but is that really the same as the one you seem to want?

set guifont=Lucida_Sans_Typewriter:h11:cANSI

Try replacing the "set gfn" with your desired "set guifont" and see if that works.

  • Thanks but I'd tried that. gfn and guifont are synonymous in vim. – dggoldst Jan 28 '10 at 23:48

I can't reproduce this.

I downloaded your gvimrc file, and ran it in gvim 7.2 like:

gvim -U pastey132157.vim

and got normal (upright) text.

Only clue I can offer is that you can set another colon-separated field just after the hXX font size to indicate the character style: i for italics, b for bold. And leaving that field blank:

set guifont=Lucida_Sans_Typewriter:h11::cANSI

sets normal type on my setup. So maybe you could give that a try.

  • Hmmmm, very interesting! I'm on Windows 7. You? Are you verifying that it has set your font to the right one? If you don't have that font installed you'll get upright text b/c it will substitute in a system font – dggoldst Jan 29 '10 at 0:32
  • Try going to the dialog box from the menu and see if it has the right font selected. – dggoldst Jan 29 '10 at 0:39
  • I'm running Win XP SP3; I definitely have Lucida Sans Typewriter. On a PC without it I get 9pt Fixedsys as a substitute, and setting from within a Vim session gives "E596: Invalid fonts(s)..." – njd Jan 29 '10 at 10:29

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


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


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).


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

set gfn="Lucida\ Sans\ Typewriter\ 10"
  • That doesn't even set it to Lucida. Try it then type :set gfn? at the command line. If you check in the menus you'll see that it will just assign it to a system default. – dggoldst Jan 28 '10 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.