mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Support 'antialias' with default renderer
This provides some support for the 'antialias' option with the NSTextView renderer. However, some fonts seem to be unaffected by this option. In particular, Monaco of point sizes up to 10 always render without antialiasing.
This commit is contained in:
committed by
Bjorn Winckler
parent
4868c3cb85
commit
2d57fac276
@@ -671,18 +671,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi}
|
||||
{only available when compiled with GUI enabled on
|
||||
Mac OS X}
|
||||
This option only has an effect in the Carbon GUI version of Vim on Mac
|
||||
OS X v10.2 or later, and in MacVim when the ATSUI renderer is used.
|
||||
When on, Vim will use smooth ("antialiased") fonts, which can be
|
||||
easier to read at certain sizes on certain displays.
|
||||
This option only has an effect in the GUI version of Vim on Mac OS X
|
||||
v10.2 or later. When on, Vim will use smooth ("antialiased") fonts,
|
||||
which can be easier to read at certain sizes on certain displays.
|
||||
|
||||
Setting this option in the Carbon version can sometimes cause problems
|
||||
if 'guifont' is set to its default (empty string).
|
||||
|
||||
The default renderer in MacVim uses the System Preferences to control
|
||||
antialiasing of text; this option is ignored. The ATSUI renderer on
|
||||
the other hand does use this option (and ignores the System
|
||||
Preferences setting).
|
||||
Support for this option is not flawless in MacVim. In particular,
|
||||
Monaco always seems to render not antialiased for point sizes up
|
||||
to 10. The ATSUI renderer has better antialias support.
|
||||
|
||||
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
|
||||
'autochdir' 'acd' boolean (default off)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
int preEditRow;
|
||||
int preEditColumn;
|
||||
int mouseShape;
|
||||
BOOL antialias;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
|
||||
@@ -111,6 +111,9 @@ enum {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// NOTE: If the default changes to 'NO' then the intialization of
|
||||
// p_antialias in option.c must change as well.
|
||||
antialias = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -334,10 +337,9 @@ enum {
|
||||
[self setCursor];
|
||||
}
|
||||
|
||||
- (void)setAntialias:(BOOL)antialias
|
||||
- (void)setAntialias:(BOOL)state
|
||||
{
|
||||
// Antialiasing is handled by the System Preferences and there seems to be
|
||||
// no way to control antialiasing with NSTextView.
|
||||
antialias = state;
|
||||
}
|
||||
|
||||
- (NSFont *)font
|
||||
@@ -448,6 +450,9 @@ enum {
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context setShouldAntialias:antialias];
|
||||
|
||||
[super drawRect:rect];
|
||||
|
||||
if (shouldDrawInsertionPoint) {
|
||||
|
||||
Reference in New Issue
Block a user