You are not logged in.

#1 2012-11-06 01:48:39

waspy
Member
From: Sagittarius A*
Registered: 2010-12-07
Posts: 40

Font problem in Gvim

I'm having a slight issue with using a specific font in Gvim. Here's the problem. When I open Gvim and select this font, it displays fine and works without any problem whatsoever. But when I use this line in my .gvimrc file,

set guifont=Adore64\ 6

and I open up a new session of Gvim, it results in garbage characters.

Now, I've tried fontforge to no avail, and of course I've spent time googling for a solution but haven't been able to solve it. I did find something about Gvim not being able to display non-monospace fonts or something along those lines, but if that's the case, why does the font display just fine if i manually change it once I've opened a new session?

Offline

#2 2012-11-08 09:20:10

noflex
Member
From: Denmark
Registered: 2011-01-28
Posts: 3

Re: Font problem in Gvim

maybe you missing a \ from my gvimrc
set guifont=\ProFont\ 10

Offline

#3 2012-11-08 19:06:44

waspy
Member
From: Sagittarius A*
Registered: 2010-12-07
Posts: 40

Re: Font problem in Gvim

noflex wrote:

maybe you missing a \ from my gvimrc
set guifont=\ProFont\ 10

Hmm, that didn't seem to make a difference. Still getting garbage characters.

Offline

#4 2012-11-08 19:29:00

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: Font problem in Gvim

Go back into Gvim and select the font from the drop down menu.  Then type

:set guifont

and see how Gvim is setting the font itself.  Then fix your own to match.


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

#5 2012-11-08 19:37:48

waspy
Member
From: Sagittarius A*
Registered: 2010-12-07
Posts: 40

Re: Font problem in Gvim

Morrad wrote:

Go back into Gvim and select the font from the drop down menu.  Then type

:set guifont

and see how Gvim is setting the font itself.  Then fix your own to match.

That's how I figured out what to put in my .gvimrc file. When I issue said command, I get the line:

guifont=Adore64 6

which is the exact same as the one in my .gvimrc.

Offline

#6 2012-11-08 21:48:58

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: Font problem in Gvim

I see, the issue is the space.  You may be able to defeat it this way:

set guifont='Adore64 6'

To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

#7 2012-11-09 00:19:15

waspy
Member
From: Sagittarius A*
Registered: 2010-12-07
Posts: 40

Re: Font problem in Gvim

Morrad wrote:

I see, the issue is the space.  You may be able to defeat it this way:

set guifont='Adore64 6'

No luck with that. Gives me an unknown error of the '6'. However it seems to successfully treat the escape sequence \ (space) correctly since at least the size seems to be right. Hmm.

Offline

#8 2012-11-09 01:04:10

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: Font problem in Gvim

I'm sorry for the wild goose chase then.

Last couple stabs in the dark^H^H^H questions:

  • Can you specify the font without the size successfully? (ie, :set guifont=Adore64)

  • Does it work when you specify a different font size?

  • What happens if you start from a given font, and manually try to set the guifont while gvim is running?

  • What is vim's encoding set to (:set encoding)?  Does changing that do anything to help?

Last edited by Morrad (2012-11-09 01:05:31)


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

#9 2012-11-09 02:23:27

waspy
Member
From: Sagittarius A*
Registered: 2010-12-07
Posts: 40

Re: Font problem in Gvim

Morrad wrote:

I'm sorry for the wild goose chase then.

Last couple stabs in the dark^H^H^H questions:

  • Can you specify the font without the size successfully? (ie, :set guifont=Adore64)

  • Does it work when you specify a different font size?

  • What happens if you start from a given font, and manually try to set the guifont while gvim is running?

  • What is vim's encoding set to (:set encoding)?  Does changing that do anything to help?

No worries man, really appreciate the help. As for those questions.

  • No luck there

  • Nope, tried 8, 10, 12 as well as 6, but still getting garbage characters (Size changes though).

  • That works

  • It's currently set to 'encoding=utf-8', and changing it to =iso8859 or =Latin1, didn't seem to work either.

It's strange because if I'm able to set it manually once Gvim is opened you would assume the exact same command would work in the .gvimrc file. And just in case there might be some conflicting commands or something, here's my full .gvimrc file.

colorscheme waspy
set nu!
set ts=4
set lines=40
set columns=100
set guifont=Adore64\ 6
set sw=4
set cin
set cinw=if,else,while,do,for,switch
syntax on
set syntax=c

Offline

#10 2012-11-09 04:22:57

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: Font problem in Gvim

I have a guess as to what may be causing problems.

Leave your .gvimrc the way you have it now, and open up a plain text file that won't have syntax highlighting.  Make a new one if necessary.  My hunch is that this should work.  You may be right about some other settings causing problems with the font settings, specifically the syntax highlighting.

Fixing this would be as simple as moving setting the font to the very bottom of the configuration so that it is the last thing that gets set. (Note: Give this a try even assuming my hunch above is wrong).


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

#11 2012-11-13 00:12:22

Morrad
Member
From: Washington State, USA
Registered: 2012-01-18
Posts: 54
Website

Re: Font problem in Gvim

Waspy, did you figure it out?  What was the root cause?


To the optimist, the glass is half full.
To the pessimist, the glass if half empty.
To the engineer, the glass is twice as big as it needs to be.

Offline

Board footer

Powered by FluxBB