Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What makes a font invalid for use in gVim?

Tags:

vim

fonts

I'm using gVim on Windows 7 and I recently added some fonts to C:\Windows\Fonts. In gVim, I can :set guifont=Font_Name some of them and it gets set as expected, but for several others I get E596 Invalid font(s): Font_Name.

Obviously the fonts which do not make the cut either have or lack some property which gVim requires of fonts it loads. Does anyone know what those are, and what, if anything, one might do to modify an existing font so that it meets those criteria?

In particular, the following fonts fail:

  • Cronos Display
  • Liberation Mono
  • Monospace

I will not be surprised to learn that these fonts are incomplete or missing something that Vim requires. I just have no idea what to check for.

like image 651
asfallows Avatar asked Apr 27 '12 02:04

asfallows


People also ask

How do I identify a font in Vim?

In Vim, pop open the GUI to select the font by typing in this command: :set guifont=* . It should open up the standard font dialog box for your platform.


1 Answers

Did you read :h guifont?

I've already made wild guesses in another very similar question but I couldn't find it ATM. In short, GVim on Windows is very picky about its fonts: it wants a monospaced font but something in the fonts you have tried is not to its liking.

In this case, "Cronos Display" is obviously not monospaced so there's no way it could work. I don't know about "Monospace" but I'm surprised "Liberation Mono" doesn't work.

You could open the fonts in a font editor to seee if they are really monospaced.

like image 134
romainl Avatar answered Oct 04 '22 04:10

romainl