Index: YLLGlobalConfig.h =================================================================== --- YLLGlobalConfig.h (revision 50) +++ YLLGlobalConfig.h (working copy) @@ -20,6 +20,7 @@ BOOL _showHiddenText; BOOL _blinkTicker; + BOOL _shouldSmoothFonts; NSFont *_eFont; NSFont *_cFont; @@ -54,6 +55,9 @@ - (BOOL)showHiddenText; - (void)setShowHiddenText:(BOOL)value; +- (BOOL)shouldSmoothFonts; +- (void)setShouldSmoothFonts:(BOOL)value; + - (int)cellWidth; - (void)setCellWidth:(int)value; Index: YLcontroller.mm =================================================================== --- YLcontroller.mm (revision 50) +++ YLcontroller.mm (working copy) @@ -24,6 +24,7 @@ [_tab setCanCloseOnlyTab: YES]; [[YLLGlobalConfig sharedInstance] setShowHiddenText: [[NSUserDefaults standardUserDefaults] boolForKey: @"ShowHiddenText"]]; + [[YLLGlobalConfig sharedInstance] setShouldSmoothFonts: [[NSUserDefaults standardUserDefaults] boolForKey: @"ShouldSmoothFonts"]]; [self loadSites]; [self updateSitesMenu]; Index: YLLGlobalConfig.m =================================================================== --- YLLGlobalConfig.m (revision 50) +++ YLLGlobalConfig.m (working copy) @@ -77,10 +77,26 @@ _bitmapColorTable[1][8] = 0xFFFFFF00; _bitmapColorTable[0][9] = 0x00000000; _bitmapColorTable[1][9] = 0x00000000; - + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + NSString *eFontName = [defaults stringForKey: @"EnglishFontName"]; + NSString *cFontName = [defaults stringForKey: @"ChineseFontName"]; + + if (! eFontName) + eFontName = @"Monaco"; + + if (! cFontName) + cFontName = @"STHeiti"; + + [defaults setObject: eFontName forKey: @"EnglishFontName"]; + [defaults setObject: cFontName forKey: @"ChineseFontName"]; + + [defaults synchronize]; + int i, j; ATSUFontID cATSUFontID, eATSUFontID; - char *cATSUFontName = "STHeiti", *eATSUFontName = "Monaco"; + char *cATSUFontName = [cFontName UTF8String], *eATSUFontName = [eFontName UTF8String]; // char *cATSUFontName = "Hiragino Kaku Gothic Pro", *eATSUFontName = "Monaco"; ATSUAttributeTag tags[2]; ByteCount sizes[2]; @@ -286,6 +302,15 @@ [[NSUserDefaults standardUserDefaults] setBool: value forKey: @"ShowHiddenText"]; } +- (BOOL)shouldSmoothFonts { + return _shouldSmoothFonts; +} + +- (void)setShouldSmoothFonts:(BOOL)value { + _shouldSmoothFonts = value; + [[NSUserDefaults standardUserDefaults] setBool: value forKey: @"ShouldSmoothFonts"]; +} + - (BOOL)blinkTicker { return _blinkTicker; } Index: YLView.mm =================================================================== --- YLView.mm (revision 50) +++ YLView.mm (working copy) @@ -888,7 +888,8 @@ } } CGContextSaveGState(myCGContext); - CGContextSetShouldSmoothFonts(myCGContext, false); + CGContextSetShouldSmoothFonts(myCGContext, + gConfig->_shouldSmoothFonts == YES ? true : false); /* Draw String row by row */ for (y = 0; y < gRow; y++) {