A.J.Mechelynck wrote:
Tim Chase wrote:
for my font plug in I need to know which OS I am running on to
choose an appropriate font.  Now when Sun Solaris where added
[cut]

sure it would - but it also means calling an external program at startup. Well, if all else fails...

Well, additionally, the 'guifont' option can take a comma-separated list of font-names. Thus, you could have it try something like

if has('unix')
    set guifont=AntialiasedFontILike,FallbackFont



Tony has a common bit of useful script that he drops on the list occasionally when this topic comes up (which you can find at

http://article.gmane.org/gmane.editors.vim/40125

) which does some platform-sniffing to set the font accordingly. A combination of these ideas should hopefully get you closer to having the font of your dreams. :)

-tim





My tip has been written up as a vim-online tip ("Setting the font in the GUI") and, since-then, it has also made it to the Vim help at ":help setting-guifont" except that the latter will set the font incorrectly in kvim, and not set it at all on non-x11 systems other than W32 (e.g. Macintosh versions with Carbon GUI).


Best regards,
Tony.


P.S. After looking at the article, I notice that I later found out that the kvim 'guifont' mentioned there was inappropriate. kvim is obsolete anyway, but some versions are still in circulation, such as the 6.2.14 that comes with SuSE Linux 9.3. If you need the (longish) kvim value, check the comments of the vim-online tip, or drop me an email.


Best regards,
Tony.

Reply via email to