4

gVim seems to have problems displaying text in Tamil (and possibly other Indic languages), even when the font supports it. For eg., here's some text in Emacs and the same text in gVim (both under Windows):

In Emacs

In Vim

Both use the exact same font here (Dejavu Sans Mono, 13). But within Vim, the characters are all overlapping with each other to the point of unreadability, whereas emacs seems to have no problem displaying it.

To make the problem clear, here's a single word from the text, first in emacs: clear text in emacs, and then in Vim unreadable in Vim.

I've tried many other Unicode monospace fonts available, and the result is the same: other editors display the Tamil glyphs without an issue, while Vim's are the same overlapping mess every time.

Is this type of rendering problems a known issue, and are there any fixes or workaround available? I'd prefer to continue editing in Vim for Tamil texts too, if it is at all possible.

  • 1
    What is the result of the following commands: :verbose set guifontwide? :verbose set guifontset? Also do you recall ever installing fonts for Tamil script on your computer? (I ask because DejaVuSansMono doesn't appear to include any glyphs for Tamil so I'm wondering if gVim is performing font substitution. – Rich Apr 10 '18 at 12:03
  • guifontwide is empty, and I get E519: Option not supported: guifontset? when I try the second command. I have a bunch of fonts for Tamil script installed, for eg. there's the default Latha included with Windows, in addition I have Lohit Tamil and Vijaya, and most recently I installed GNU Unifont which includes glyphs for Tamil (verified these by looking at the Tamil Unicode subrange of these fonts in Windows charmap). I tried setting these as the guifontwide, but I get 'Invalid wide font' error, and I don't know fonts enough to understand what would be a valid wide font. – sundar Apr 10 '18 at 13:47
  • What happens if you set one of those as your guifont? – Rich Apr 10 '18 at 14:21
  • I just get an E596: Invalid font. There's more evidence for the font substitution theory though: I restarted my computer in the mean time (for the first time after installing Unifont), and the Tamil glyph rendering inside Vim is relatively noticeably better now, even though I haven't changed the actual font Vim is supposed to use. My guess is that the font used for font substitution has automatically changed since a new one became available. Is there any way to find out what the font substitution process is doing, and perhaps customize the font options used for substitution? – sundar Apr 11 '18 at 7:16
  • Unifont's page says the font files "contain dimension and spacing information for each glyph in a font. Some font rendering engines ignore this glyph information that the font file provides. This is especially true of rendering engines designed to handle monospace fonts. Unifont will not display all glyphs correctly with such software." I'm guessing this is what is happening here. Being able to specify a higher width on the substituting font would help with making the rendering better. (A monospaced Tamil font would help more, but I haven't found one.) – sundar Apr 11 '18 at 8:05

Your Answer

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

Browse other questions tagged or ask your own question.