Setting antialiased font in Vim.app on OS X 10.2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting antialiased font in Vim.app on OS X 10.2

Nick Lo
Hello,

I'm just experimenting with/trying out Vim and so far have only had the
following issue for which I cannot find an answer: I seem to be unable
to set the font to not be antialiased (without a hack) in any of the
Vim.app versions for OS X 10.2 downloaded from:

http://macvim.org/OSX/index.php#Downloading

It does not seem to recognise :set noanti or :set noantialias or the
same set in my ~/.vimrc or ~/.gvimrc. What I want to use is Monaco 10
and ironically the only way I seem to be able to get it to be
antialiased is to put in an incorrect setting like so:

set guifont=Monaco:h10:ANSI
set noantialias=0

This hack works in that Vim then works with a non-antialiased font but
it does of course throw up an error message when Vim starts up which
I'd prefer it not to.

Thanks in advance,

Nick



Reply | Threaded
Open this post in threaded view
|

Re: Setting antialiased font in Vim.app on OS X 10.2

Bram Moolenaar

Nick Lo wrote:

> I'm just experimenting with/trying out Vim and so far have only had the
> following issue for which I cannot find an answer: I seem to be unable
> to set the font to not be antialiased (without a hack) in any of the
> Vim.app versions for OS X 10.2 downloaded from:
>
> http://macvim.org/OSX/index.php#Downloading
>
> It does not seem to recognise :set noanti or :set noantialias or the
> same set in my ~/.vimrc or ~/.gvimrc. What I want to use is Monaco 10
> and ironically the only way I seem to be able to get it to be
> antialiased is to put in an incorrect setting like so:
>
> set guifont=Monaco:h10:ANSI
> set noantialias=0
>
> This hack works in that Vim then works with a non-antialiased font but
> it does of course throw up an error message when Vim starts up which
> I'd prefer it not to.

Very strange.  Does it work when you do ":set noantialias" after
starting the GUI (then do CTRL-L to redraw)?  There might be something
with pre- and post- initializations.

--
Violators can be fined, arrested or jailed for making ugly faces at a dog.
                [real standing law in Oklahoma, United States of America]

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: Setting antialiased font in Vim.app on OS X 10.2

Nick Lo
Hi Bram,

I tried that and it doesn't work. Nor does it seem to matter where I
try...

"set noanti" or "set noantialias"

...neither in ~/.vimrc or ~/.gvimrc, or as a command after starting the
gui. It always results in a nastily aliased version of Monaco.

Thanks for the reply,

Nick

>> I'm just experimenting with/trying out Vim and so far have only had
>> the
>> following issue for which I cannot find an answer: I seem to be unable
>> to set the font to not be antialiased (without a hack) in any of the
>> Vim.app versions for OS X 10.2 downloaded from:
>>
>> http://macvim.org/OSX/index.php#Downloading
>>
>> It does not seem to recognise :set noanti or :set noantialias or the
>> same set in my ~/.vimrc or ~/.gvimrc. What I want to use is Monaco 10
>> and ironically the only way I seem to be able to get it to be
>> antialiased is to put in an incorrect setting like so:
>>
>> set guifont=Monaco:h10:ANSI
>> set noantialias=0
>>
>> This hack works in that Vim then works with a non-antialiased font but
>> it does of course throw up an error message when Vim starts up which
>> I'd prefer it not to.
>
> Very strange.  Does it work when you do ":set noantialias" after
> starting the GUI (then do CTRL-L to redraw)?  There might be something
> with pre- and post- initializations.

Reply | Threaded
Open this post in threaded view
|

Re: Setting antialiased font in Vim.app on OS X 10.2

A.J.Mechelynck
In reply to this post by Nick Lo
----- Original Message -----
From: "Nick Lo" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, July 26, 2005 6:07 AM
Subject: Setting antialiased font in Vim.app on OS X 10.2


> Hello,
>
> I'm just experimenting with/trying out Vim and so far have only had the
> following issue for which I cannot find an answer: I seem to be unable to
> set the font to not be antialiased (without a hack) in any of the Vim.app
> versions for OS X 10.2 downloaded from:
>
> http://macvim.org/OSX/index.php#Downloading
>
> It does not seem to recognise :set noanti or :set noantialias or the same
> set in my ~/.vimrc or ~/.gvimrc. What I want to use is Monaco 10 and
> ironically the only way I seem to be able to get it to be antialiased is
> to put in an incorrect setting like so:
>
> set guifont=Monaco:h10:ANSI
> set noantialias=0
>
> This hack works in that Vim then works with a non-antialiased font but it
> does of course throw up an error message when Vim starts up which I'd
> prefer it not to.
>
> Thanks in advance,
>
> Nick

Strange. According to the help, the default is for gvim to use
non-antialiased fonts. It also says the 'antialias' option only works on
gvim for Mac OS X 10.2 or later. Try the following:

1. Comment away the line "set noantialias=0" in your vimrc by adding a
double quote before it
2. Restart gvim
3. Enter

    :echo exists("+antialias")

and write down the answer.
4. If the answer above is 0, you don't have a functioning 'antialias'
option. Otherwise, do

    :verbose set antialias?

and write down the answer. It will be either "  antialias" or "noantialias"
and, if that option was set by a script, it will tell you which one. This
may help you solve your problem.

You might also take a look at the output of the ":version" command (and, if
you want to keep a copy of it, don't copy it by hand but by means of the
":redir" command).

If the above is of no help, you might try replacing your "set noantialias=0"
statement (which is supposed to be incorrect anyway) by something else,
maybe "let &antialias = 0" (without the quotes of course) which "ought" to
work.

P.S. At the end of your ":set guifont" command, it should be :cANSI, not
just :ANSI -- though IMHO :cDEFAULT is better (I use it, and my Windows gvim
will pick the correct glyphs for at least Latin, Cyrillic, Arabic and
Chinese, if the font has them).


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: Setting antialiased font in Vim.app on OS X 10.2

Nick Lo
Hi Tony,

> Strange. According to the help, the default is for gvim to use
> non-antialiased fonts. It also says the 'antialias' option only works
> on gvim for Mac OS X 10.2 or later. Try the following:
>
> 1. Comment away the line "set noantialias=0" in your vimrc by adding a
> double quote before it
> 2. Restart gvim
> 3. Enter
>
>    :echo exists("+antialias")
>
> and write down the answer.

The answer is 1

> 4. If the answer above is 0, you don't have a functioning 'antialias'
> option. Otherwise, do
>
>    :verbose set antialias?
>
> and write down the answer. It will be either "  antialias" or
> "noantialias" and, if that option was set by a script, it will tell
> you which one. This may help you solve your problem.

The answer is just noantialias and oddly it always says noantialias
whether I see an antialised or aliased (due to my hack) font.

> You might also take a look at the output of the ":version" command
> (and, if you want to keep a copy of it, don't copy it by hand but by
> means of the ":redir" command).

It outputs:

VIM - Vi IMproved 6.3 (2004 June 7, compiled Jun  8 2004 06:58:25)
MacOS X (unix) version
Modified by Peter Cucka
Compiled by Peter Cucka <http://www.macvim.swdev.org/OSX>
Huge version with Carbon GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval +browse ++builtin_terms +byte_offset
+cindent -clientserver +clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +cryptv +cscope +dialog_con_gui +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +folding -footer +fork() -gettext
-hangul_input -iconv +insert_expand +jumplist +keymap +langmap -libcall
+linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
-mouse_netterm -mouse_xterm +multi_byte +multi_lang -netbeans_intg
-osfiletype +path_extra +perl +postscript +printer +python +quickfix
+rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
+terminfo +termresponse +textobjects +title -toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo  +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save

system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"

Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -arch
ppc -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas
-mdynamic-no-pic -pipe -I. -Iproto -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
-I/Developer/Headers/FlatCarbon -no-cpp-precomp  -O2
-fno-strength-reduce -Wall   -DFEAT_PERL
-I/System/Library/Perl/darwin/CORE -I/usr/include/python2.2
Linking: gcc   -L/usr/local/lib -o Vim -framework Carbon      -lncurses
   -L/System/Library/Perl/darwin/CORE -lperl -L/usr/lib/python2.2/config
-lpython2.2 -u __dummy -u _PyMac_Error -framework System -framework
CoreServices -framework Foundation

> If the above is of no help, you might try replacing your "set
> noantialias=0" statement (which is supposed to be incorrect anyway) by
> something else, maybe "let &antialias = 0" (without the quotes of
> course) which "ought" to work.

Well that does work in that the resulting font is aliased Monaco,
however it still generates an error message on start ("unknown option:
noantialias").

> P.S. At the end of your ":set guifont" command, it should be :cANSI,
> not just :ANSI -- though IMHO :cDEFAULT is better (I use it, and my
> Windows gvim will pick the correct glyphs for at least Latin,
> Cyrillic, Arabic and Chinese, if the font has them).

Yes noted and reset to cDEFAULT.

Thanks very much for your help, even if it didn't immediately solve the
font issue I learnt about :redir, so much appreciated,

Nick

Reply | Threaded
Open this post in threaded view
|

Re: Setting antialiased font in Vim.app on OS X 10.2

A.J.Mechelynck
----- Original Message -----
From: "Nick Lo" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, July 26, 2005 3:47 PM
Subject: Re: Setting antialiased font in Vim.app on OS X 10.2


> Hi Tony,
>
>> Strange. According to the help, the default is for gvim to use
>> non-antialiased fonts. It also says the 'antialias' option only works on
>> gvim for Mac OS X 10.2 or later. Try the following:
>>
>> 1. Comment away the line "set noantialias=0" in your vimrc by adding a
>> double quote before it
>> 2. Restart gvim
>> 3. Enter
>>
>>    :echo exists("+antialias")
>>
>> and write down the answer.
>
> The answer is 1
>
>> 4. If the answer above is 0, you don't have a functioning 'antialias'
>> option. Otherwise, do
>>
>>    :verbose set antialias?
>>
>> and write down the answer. It will be either "  antialias" or
>> "noantialias" and, if that option was set by a script, it will tell you
>> which one. This may help you solve your problem.
>
> The answer is just noantialias and oddly it always says noantialias
> whether I see an antialised or aliased (due to my hack) font.
>
>> You might also take a look at the output of the ":version" command (and,
>> if you want to keep a copy of it, don't copy it by hand but by means of
>> the ":redir" command).
>
> It outputs:
>
> VIM - Vi IMproved 6.3 (2004 June 7, compiled Jun  8 2004 06:58:25)
> MacOS X (unix) version
> Modified by Peter Cucka
> Compiled by Peter Cucka <http://www.macvim.swdev.org/OSX>
> Huge version with Carbon GUI.  Features included (+) or not (-):
> +arabic +autocmd -balloon_eval +browse ++builtin_terms +byte_offset
> +cindent -clientserver +clipboard +cmdline_compl +cmdline_hist
> +cmdline_info +comments +cryptv +cscope +dialog_con_gui +diff
> +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
> +file_in_path +find_in_path +folding -footer
> +fork() -gettext -hangul_input -iconv +insert_expand +jumplist +keymap
> +langmap -libcall +linebreak +lispindent +listcmds +localmap +menu
> +mksession +modify_fname
> +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_xterm
> +multi_byte +multi_lang -netbeans_intg -osfiletype +path_extra +perl
> +postscript +printer +python +quickfix +rightleft -ruby +scrollbind +signs
> +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
> +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects
> +title -toolbar +user_commands +vertsplit +virtualedit +visual
> +visualextra +viminfo  +vreplace +wildignore +wildmenu +windows
> +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
>
> system vimrc file: "$VIM/vimrc"
> user vimrc file: "$HOME/.vimrc"
> user exrc file: "$HOME/.exrc"
> system gvimrc file: "$VIM/gvimrc"
> user gvimrc file: "$HOME/.gvimrc"
> system menu file: "$VIMRUNTIME/menu.vim"
> fall-back for $VIM: "/usr/local/share/vim"
>
> Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MAC -arch
> ppc -fno-common -fpascal-strings -Wall -Wno-unknown-pragmas -mdynamic-no-pic
>  -pipe -I. -Iproto -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp
>  -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
>  -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon
>  -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp
>  -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
>  -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon
>  -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp
>  -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
>  -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon
>  -no-cpp-precomp -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp
>  -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -DMACOS_X_UNIX
>  -I/Developer/Headers/FlatCarbon -no-cpp-precomp  -O2 -fno-strength-reduce
>  -Wall   -DFEAT_PERL -I/System/Library/Perl/darwin/CORE -I/usr/include/python2.2
> Linking: gcc   -L/usr/local/lib -o Vim -framework
> Carbon      -lncurses -L/System/Library/Perl/darwin/CORE -lperl -L/usr/lib/python2.2/config
>  -lpython2.2 -u __dummy -u _PyMac_Error -framework System -framework
> CoreServices -framework Foundation
>
>> If the above is of no help, you might try replacing your "set
>> noantialias=0" statement (which is supposed to be incorrect anyway) by
>> something else, maybe "let &antialias = 0" (without the quotes of course)
>> which "ought" to work.
>
> Well that does work in that the resulting font is aliased Monaco, however
> it still generates an error message on start ("unknown option:
> noantialias").
>
>> P.S. At the end of your ":set guifont" command, it should be :cANSI, not
>> just :ANSI -- though IMHO :cDEFAULT is better (I use it, and my Windows
>> gvim will pick the correct glyphs for at least Latin, Cyrillic, Arabic
>> and Chinese, if the font has them).
>
> Yes noted and reset to cDEFAULT.
>
> Thanks very much for your help, even if it didn't immediately solve the
> font issue I learnt about :redir, so much appreciated,
>
> Nick

There might be something wrong in the way your gvim was compiled. What hints
at this are:

a) If exists("+antialias") is 1, then the message "Unknown option:
noantialias" should not appear. But you might want to use &antialias, not
&noantialias, in the ":let" statement, and use 1 (for antialiasing) or 0
(for no antialiasing) on the right-hand side of the =
b) All those repeated identical lines under "Compilation"
("-DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp") ought to
appear at most once.
c) "Modified by Peter Cucka" means something was changed from the "original"
Vim sources.

If you have the savvy and the software, you might try recompiling from
source. Otherwise, try getting in contact with Peter Cucka. (You can get the
sources from the same place I do, see
http://users.skynet.be/antoine.mechelynck/vim/compile.htm ; the "Unix",
"Extra" and "Lang" archives, plus the patches, all taken together [for 6.3],
or the snapshots [for 7.00aa] are supposed to be good for all platforms. How
to compile them will be different, since you are on a Unix-like platform.)


Best regards,
Tony.