Hi,

Nicolas Aggelidis wrote:
> 
> but i still have one question:
> 
> I want by default to use ttf-inconsolata fonts but if i haven't
> installed them on a system i want to go back on monospace.
> is there any way to do this within the vimrc?
> 
> set guifont=monospace\ 14
> if has(...)
> set guifont=Inconsolata\ 14
> endif
> 
> in other is it possible to check for the existence of a font from within vim?

I don't think you can check wether a certain font is installed on your
system, but you can just try to use it and catch the exception thrown
by Vim if the font is not installed:

    try
        set guifont=Inconsolata\ 14
    catch /^Vim\%((\a\+)\)\=:E596/
        set guifont=monospace\ 14
    endtry

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to