Saturday, November 3, 2012

Re: Setting guifont in .gvimrc goes wrong

On 03/11/12 12:49, Marcel Korpel wrote:
> Hi,
>
> Perhaps it is me doing something stupid, but I am not able to set a
> specific font *and* font size in my .gvimrc. Here is what I did.
>
> 1) I patched Ubuntu Mono using the instructions in [1] and installed
> this font properly (I can select it and choose the added symbols).
>
> 2) I typed :set guifont=Ubuntu\ Mono\ for\ Powerline\ 12 and confirmed
> with Ctrl-v + u + 2b60 that the correct font was selected (the added
> branch symbol appeared).
>
> 3) I changed the guifont line in my .gvimrc to
>
> set guifont=Ubuntu\ Mono\ for \ Powerline\ 12
-------------------------------^
there should be no space here
>
> 4) I restarted Vim, but it fell back to a default sans serif font
>
> 5) I changed the guifont line to
>
> set guifont=Ubuntu\ Mono\ for \ Powerline
-------------------------------^
>
> 6) Restarted Vim again and the correct font was selected, but the font
> size was wrong (defaults to 10, I think).

Well, since you did nopt specify a font size, Vim has to use some
default size. Yes, I think 10 is the default, but I'm not sure if it's
10pt or 10px.

>
> 7) Did 2) again and the size was correct again.
>
> Now, why can't I select this font *and* the font size in my .gvimrc?

You can, but you must type the vimrc line without a single typo in it,
otherwise Vim will fall back on some (usually ugly) system default font.

> Originally, `set guifont=Ubuntu\ Mono\ 12` in my .gvimrc worked
> correctly. What am I doing wrong?
>
> Thanks in advance.
>
> Marcel
>
> [1] https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher#linux
>

To change only the size, you can type
:set gfn=<Tab>
where <Tab> means "hit the Tab key" and is not followed by hitting the
Enter key. Vim will fill in the current value, with escaping backslashes
if and where necessary. Edit the command-line, then hit Enter to accept
or Esc to cancel.

Or, on some GUI flavours including GTK2, you can type
:set gfn=*
(with Enter) to choose a font from a dialog. See
http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI
for details.


Best regards,
Tony.
--
Radioactive cats have 18 half-lives.

--
You received this message from the "vim_use" 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

No comments: