What makes a font invalid for use in gVim?

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

Obviously, fonts that do not cut, have or do not have any property that gVim requires from the fonts that it loads. Does anyone know what it is, and what, if anything, can be done to modify an existing font so that it meets these criteria?

In particular, the following fonts fail:

I would not be surprised to know that these fonts are incomplete or missing what Vim requires. I just have no idea what to check.

+6
source share
2 answers

Have you read :h guifont ?

I already made wild guesses in another very similar question, but I could not find it in an ATM. In short, GVim on Windows is very legible in its fonts: it wants a monospace font, but something in your fonts that you tried is not to your liking.

In this case, the β€œCronos Display” is clearly not monospaced, so it cannot work. I do not know about "Monospace", but I am surprised that "Liberation Mono" does not work.

You can open fonts in the font editor to see if they are really monospaced.

+5
source

Here is a similar question that I asked, oddly enough, that same week.

In my case, it came down to two things that I was able to configure using FontForge:

  • Having the correct PANOSE tag (whatever it is) is "Monospaced" instead of "Even Width"
  • All characters must be the same width. I was able to fix this by doing the following:

    • Select all items
    • Element β†’ Validation β†’ Find Problems
    • Select random β†’ mismatch in raster / contour structure
    • Choose BB β†’ Check Advance: 600
    • Choose OK

In my case, he gave a list of all elements with a width of 0 one after another and gave me the opportunity to fix their width of 600.

The change seems to have worked for me, but I may have committed some kind of feature.

+1
source

Source: https://habr.com/ru/post/914286/


All Articles