From 0b5be59ffecd30203ecb72245681dc9291c5beaf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 2 May 2013 09:46:17 +1000 Subject: Feature: [feature-requests:#988]. Cocoa support for font quality. From Mark Yen. --- cocoa/ScintillaCocoa.mm | 8 ++ cocoa/ScintillaTest/AppController.mm | 5 + cocoa/ScintillaTest/English.lproj/MainMenu.xib | 124 +++++++++++++++++++++++++ doc/ScintillaHistory.html | 4 + 4 files changed, 141 insertions(+) diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 004a1dc46..f018aa351 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1525,6 +1525,14 @@ bool ScintillaCocoa::SyncPaint(void* gc, PRectangle rc) Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (sw) { + CGContextSetAllowsAntialiasing((CGContextRef)gc, + vs.extraFontFlag != SC_EFF_QUALITY_NON_ANTIALIASED); +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 + if (CGContextSetAllowsFontSubpixelPositioning != NULL) + CGContextSetAllowsFontSubpixelPositioning((CGContextRef)gc, + vs.extraFontFlag == SC_EFF_QUALITY_DEFAULT || + vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED); +#endif sw->Init(gc, wMain.GetID()); Paint(sw, rc); succeeded = paintState != paintAbandoned; diff --git a/cocoa/ScintillaTest/AppController.mm b/cocoa/ScintillaTest/AppController.mm index c28974109..168a67681 100644 --- a/cocoa/ScintillaTest/AppController.mm +++ b/cocoa/ScintillaTest/AppController.mm @@ -271,6 +271,11 @@ static const char * box_xpm[] = { [self showAutocompletion]; } +-(IBAction) setFontQuality: (id) sender +{ + [ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0]; +} + @end //-------------------------------------------------------------------------------------------------- diff --git a/cocoa/ScintillaTest/English.lproj/MainMenu.xib b/cocoa/ScintillaTest/English.lproj/MainMenu.xib index 6de460712..e2d93cca3 100644 --- a/cocoa/ScintillaTest/English.lproj/MainMenu.xib +++ b/cocoa/ScintillaTest/English.lproj/MainMenu.xib @@ -856,6 +856,56 @@ + + + Font Quality + + 2147483647 + + + submenuAction: + + Font Quality + + YES + + + Default + + 2147483647 + + + + + + Non-antialiased + + 2147483647 + + + 1 + + + + Antialiased + + 2147483647 + + + 2 + + + + LCD Optimized + + 2147483647 + + + 3 + + + + YES @@ -1833,6 +1883,38 @@ 468 + + + setFontQuality: + + + + 475 + + + + setFontQuality: + + + + 476 + + + + setFontQuality: + + + + 477 + + + + setFontQuality: + + + + 478 + @@ -2537,6 +2619,7 @@ + @@ -2771,6 +2854,47 @@ + + 469 + + + YES + + + + + + 470 + + + YES + + + + + + + + + 471 + + + + + 472 + + + + + 473 + + + + + 474 + + + diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 8fad9ceb8..3cb00e271 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -450,6 +450,10 @@ appearance used for Asian language input composition.
  • + On Cocoa implement font quality setting. + Feature #988. +
  • +
  • On Cocoa implement automatic enabling of commands and added clear command. Feature #987.
  • -- cgit v1.2.3