guifont setting problems

124 views
Skip to first unread message

Ivan Kanakarakis

unread,
May 24, 2013, 1:10:18 PM5/24/13
to vim_dev
Hey people,

I found a nice font called "Cousine".
Trying it on my running gvim window, with ':set gfn=Cousine\ 10'
I likec it and decided to make it the default when opening gvim.
So, I opened up ~/.gvimrc and edited it to:

  colorscheme molokai
  set guifont=Cousine\ 10

(that's the whole ~/.gvimrc) 
Upon opening gvim I got this: http://i.imgur.com/FfZHYCR.png

"Blindly" typing ':set gfn=' resets the font to monospace and show fine
If I continue with ':set gfn=Cousine\ 10' I get again the nice look of this font.

Asking on irc for possible explanations mgedmin prompted to try 
adding 'gui' before setting the guifont, so changing my ~/.gvimrc to

  colorscheme molokai
  gui
  set guifont=Cousine\ 10

fixed it, and gvim now loads the font and works great.

So, could this be a bug ? 

Let me note that if I change ~/.gvim to

  colorscheme molokai
  set guifont=DejaVu\ Sans\ Mono\ 12

then it loads that font fine, no need for 'gui'.

I am using VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 28 2013 10:08:34)
and attached is the bugreport.txt 

Thanks,

--
Ivan c00kiemon5ter Kanakarakis  >:3 
bugreport.txt

Tony Mechelynck

unread,
Jun 4, 2013, 11:28:15 PM6/4/13
to vim...@googlegroups.com, ivan....@gmail.com
1. ":set guifont=Cousine\ 10" is only for gvim with GTK2 GUI. On Windows, AFAIK that can only exist for running under Cygwin X11 with the Cygwin DLL. For "native" Windows (running with no help of Cygwin or X11), you should use ":set guifont=Cousine:h10:cDEFAULT".

2. You should set 'guifont' in your vimrc so it loads at the very start of GUI startup (it will be remembered until then). In the gvimrc I think it is too late.

3. Which sort of GUI you got is displayed near the top of the output of ":version".

4. See http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI for details.


Best regards,
Tony.
--
"I had to hit him -- he was starting to make sense."



--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ivan Kanakarakis

unread,
Jun 5, 2013, 6:45:28 AM6/5/13
to Tony Mechelynck, vim...@googlegroups.com
On 5 June 2013 06:28, Tony Mechelynck <antoine.m...@gmail.com> wrote:
1. ":set guifont=Cousine\ 10" is only for gvim with GTK2 GUI. On Windows, AFAIK that can only exist for running under Cygwin X11 with the Cygwin DLL. For "native" Windows (running with no help of Cygwin or X11), you should use ":set guifont=Cousine:h10:cDEFAULT".


​I am using Linux and thus gvim is running on top of GTK2.

 
2. You should set 'guifont' in your vimrc so it loads at the very start of GUI startup (it will be remembered until then). In the gvimrc I think it is too late.


​This is very non-intuitive. I​ tried it, and it gets me the same result.
Specifically, I removed ~/.gvimrc and added 'set guifont=Cousine\ 10'
as the very first line of my ~/.vimrc , the result is the same.

 
3. Which sort of GUI you got is displayed near the top of the output of ":version".


​Right, it is GTK2 as expected:

  VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 19 2013 18:32:57)
  Included patches: 1-918
  Compiled by ArchLinux
  Huge version with GTK2 GUI.  Features included (+) or not (-):
  [...]

 

​Thanks for the link and the answer

 

Ben Fritz

unread,
Jun 5, 2013, 11:21:26 AM6/5/13
to vim...@googlegroups.com, vim_dev
On Friday, May 24, 2013 12:10:18 PM UTC-5, c00kiemon5ter wrote:
>
>   colorscheme molokai
>   set guifont=Cousine\ 10
>
> (that's the whole ~/.gvimrc) 
>
> Upon opening gvim I got this: http://i.imgur.com/FfZHYCR.png
>

I can't see anything like this on Windows. Setting my font to Cousine in my .vimrc works just fine.

I got Cousine from: http://www.google.com/fonts#UsePlace:use/Collection:Cousine

Is the same font you've found?

>
> adding 'gui' before setting the guifont, so changing my ~/.gvimrc to
>
>   colorscheme molokai
>   gui
>   set guifont=Cousine\ 10
>
> fixed it, and gvim now loads the font and works great.
>
> So, could this be a bug ? 

So, the GUI actually needs to be running before setting the font works? That's not normal, it could be a bug.

Can you reproduce it with no plugins or .vimrc or anything at all, except for setting the font?

As a nicer workaround you could use a GUIEnter autocmd to set the font.

>
> Let me note that if I change ~/.gvim to
>
>   colorscheme molokai
>   set guifont=DejaVu\ Sans\ Mono\ 12
>
> then it loads that font fine, no need for 'gui'.
>

Curiouser and curiouser! Have you found any other fonts that suffer this issue? I wonder if it is an anti-aliasing thing or something. I don't know how to check that.

Ivan Kanakarakis

unread,
Jun 5, 2013, 11:34:38 AM6/5/13
to vim...@googlegroups.com, vim_dev
On 5 June 2013 18:21, Ben Fritz <fritzo...@gmail.com> wrote:
> On Friday, May 24, 2013 12:10:18 PM UTC-5, c00kiemon5ter wrote:
>>
>> colorscheme molokai
>> set guifont=Cousine\ 10
>>
>> (that's the whole ~/.gvimrc)
>>
>> Upon opening gvim I got this: http://i.imgur.com/FfZHYCR.png
>>
>
> I can't see anything like this on Windows. Setting my font to Cousine in my .vimrc works just fine.
>
> I got Cousine from: http://www.google.com/fonts#UsePlace:use/Collection:Cousine
>
> Is the same font you've found?
>

I think I got it from fontsquirrel:
http://www.fontsquirrel.com/fonts/cousine


>>
>> adding 'gui' before setting the guifont, so changing my ~/.gvimrc to
>>
>> colorscheme molokai
>> gui
>> set guifont=Cousine\ 10
>>
>> fixed it, and gvim now loads the font and works great.
>>
>> So, could this be a bug ?
>
> So, the GUI actually needs to be running before setting the font works? That's not normal, it could be a bug.
>
> Can you reproduce it with no plugins or .vimrc or anything at all, except for setting the font?
>

Yes, it is reproducible.
Removing ~/.gvimrc and having ~/.vimrc to only include

set guifont=Cousine\ 10

I get the same result; less colourful: http://i.imgur.com/ptHM4NE.png


> As a nicer workaround you could use a GUIEnter autocmd to set the font.
>
>>
>> Let me note that if I change ~/.gvim to
>>
>> colorscheme molokai
>> set guifont=DejaVu\ Sans\ Mono\ 12
>>
>> then it loads that font fine, no need for 'gui'.
>>
>
> Curiouser and curiouser! Have you found any other fonts that suffer this issue? I wonder if it is an anti-aliasing thing or something. I don't know how to check that.
>

No; no other fonts that I've tried did this.
I attached the font files in case someone
is interested in trying with those files.

I don't think bad or even horrible antialiasing
could cause that. It mostly looks like the
font file is not read correctly.

I will now try with the font files from google

Thanks


> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/uxS2HxmzdZc/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



SIL Open Font License 1.1.txt
Cousine-Bold-Latin.ttf
Cousine-BoldItalic-Latin.ttf
Cousine-Italic-Latin.ttf
Cousine-Regular-Latin.ttf

Ivan Kanakarakis

unread,
Jun 5, 2013, 11:49:04 AM6/5/13
to vim...@googlegroups.com, vim_dev
On 5 June 2013 18:34, Ivan Kanakarakis <ivan....@gmail.com> wrote:
> On 5 June 2013 18:21, Ben Fritz <fritzo...@gmail.com> wrote:
>> On Friday, May 24, 2013 12:10:18 PM UTC-5, c00kiemon5ter wrote:
>>>
>>> colorscheme molokai
>>> set guifont=Cousine\ 10
>>>
>>> (that's the whole ~/.gvimrc)
>>>
>>> Upon opening gvim I got this: http://i.imgur.com/FfZHYCR.png
>>>
>>
>> I can't see anything like this on Windows. Setting my font to Cousine in my .vimrc works just fine.
>>
>> I got Cousine from: http://www.google.com/fonts#UsePlace:use/Collection:Cousine
>>
>> Is the same font you've found?
>>
>
> I think I got it from fontsquirrel:
> http://www.fontsquirrel.com/fonts/cousine
>

Success :D
Using the fonts from google it seems that everything is fine.

>
>>>
>>> adding 'gui' before setting the guifont, so changing my ~/.gvimrc to
>>>
>>> colorscheme molokai
>>> gui
>>> set guifont=Cousine\ 10
>>>
>>> fixed it, and gvim now loads the font and works great.
>>>
>>> So, could this be a bug ?
>>
>> So, the GUI actually needs to be running before setting the font works? That's not normal, it could be a bug.
>>
>> Can you reproduce it with no plugins or .vimrc or anything at all, except for setting the font?
>>
>
> Yes, it is reproducible.
> Removing ~/.gvimrc and having ~/.vimrc to only include
>
> set guifont=Cousine\ 10
>
> I get the same result; less colourful: http://i.imgur.com/ptHM4NE.png
>
>
>> As a nicer workaround you could use a GUIEnter autocmd to set the font.
>>
>>>
>>> Let me note that if I change ~/.gvim to
>>>
>>> colorscheme molokai
>>> set guifont=DejaVu\ Sans\ Mono\ 12
>>>
>>> then it loads that font fine, no need for 'gui'.
>>>
>>
>> Curiouser and curiouser! Have you found any other fonts that suffer this issue? I wonder if it is an anti-aliasing thing or something. I don't know how to check that.
>>
>
> No; no other fonts that I've tried did this.
> I attached the font files in case someone
> is interested in trying with those files.
>
> I don't think bad or even horrible antialiasing
> could cause that. It mostly looks like the
> font file is not read correctly.
>

So, I guess it was the font files that were corrupted
and not a bug. That's a good thing.


> I will now try with the font files from google
>
> Thanks
>
>
>> --
>> --
>> You received this message from the "vim_dev" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>> ---
>> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/uxS2HxmzdZc/unsubscribe?hl=en.
>> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
>
> --
> Ivan c00kiemon5ter Kanakarakis >:3


Thanks for all the help again

Ben Fritz

unread,
Jun 5, 2013, 11:52:20 AM6/5/13
to vim...@googlegroups.com, vim_dev
On Wednesday, June 5, 2013 10:34:38 AM UTC-5, c00kiemon5ter wrote:
>
>
> I don't think bad or even horrible antialiasing
>
> could cause that. It mostly looks like the
>
> font file is not read correctly.
>
>

Agree. I meant, maybe when the GUI is not actually running, Vim can't load fonts with anti-aliasing or ClearType or whatever defined.

>
> I will now try with the font files from google
>

Sounds good. I was not able to reproduce the issue on Windows with the fonts you attached. They do differ than the Google fonts somehow though.

Reply all
Reply to author
Forward
0 new messages