Changed Win32 antialiasing to ClearType, modified textured button gradient style to match Cocoa

This commit is contained in:
Pauli Ojala 2011-07-29 13:45:57 +03:00
parent cf371c2993
commit 5f6477a115
3 changed files with 19 additions and 8 deletions

View File

@ -664,7 +664,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
BOOL pressed=[self state] && ([self showsStateBy] & NSChangeBackgroundCellMask);
BOOL renderDarkenBg=NO, renderOutlineShadow=NO;
CGFloat topGray=0.76, bottomGray=0.98, strokeGray=0.4;
//CGFloat topGray=0.76, bottomGray=0.98, strokeGray=0.4;
CGFloat topGray=0.98, bottomGray=0.76, strokeGray=0.4;
if (pressed) {
topGray=0.4;
bottomGray=0.30;

View File

@ -77,7 +77,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if(_dc==NULL)
return;
O2SurfaceLock(_surface);
//O2SurfaceLock(_surface);
O2GState *gState=O2ContextCurrentGState(self);
NSArray *phases=[O2GStateClipState(gState) clipPhases];
@ -108,7 +108,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
}
O2SurfaceUnlock(_surface);
//O2SurfaceUnlock(_surface);
}
#if 0
@ -283,7 +283,7 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self){
-(void)showGlyphs:(const O2Glyph *)glyphs advances:(const O2Size *)advances count:(unsigned)count {
O2SurfaceLock(_surface);
//O2SurfaceLock(_surface);
O2GState *gState=O2ContextCurrentGState(self);
O2Font *font=O2GStateFont(gState);
@ -473,7 +473,7 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self){
if(face==NULL){
NSLog(@"face is NULL");
O2SurfaceUnlock(_surface);
//O2SurfaceUnlock(_surface);
return;
}
@ -481,7 +481,7 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self){
if((ftError=FT_Set_Char_Size(face,0,ABS(fontSize.height)*64,72.0,72.0))!=0){
NSLog(@"FT_Set_Char_Size returned %d",ftError);
O2SurfaceUnlock(_surface);
//O2SurfaceUnlock(_surface);
return;
}
@ -525,7 +525,7 @@ static inline void purgeGlyphCache(O2Context_builtin_gdi *self){
O2ContextConcatAdvancesToTextMatrix(self,useAdvances,count);
O2SurfaceUnlock(_surface);
//O2SurfaceUnlock(_surface);
}
@end

View File

@ -8,6 +8,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Onyx2D/Win32Font.h>
#ifndef CLEARTYPE_QUALITY
#define CLEARTYPE_QUALITY 5
#endif
#ifndef CLEARTYPE_NATURAL_QUALITY
#define CLEARTYPE_NATURAL_QUALITY 6
#endif
@implementation Win32Font
-initWithName:(NSString *)name height:(int)height antialias:(BOOL)antialias {
@ -20,7 +29,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_handle=CreateFontW(height,0,0,0,FW_NORMAL,
FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
antialias?ANTIALIASED_QUALITY:DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,buffer);
antialias?CLEARTYPE_QUALITY:DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,buffer);
return self;
}