diff options
| author | nyamatongwe <devnull@localhost> | 2009-11-02 04:51:51 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2009-11-02 04:51:51 +0000 | 
| commit | 212257e28c87cd6ed2ff244ee6518be0c73fa342 (patch) | |
| tree | 517893f316edf898a972316bbcd3b7b64c82de0f /src | |
| parent | a307f5df25fbf8f4e545bdd74a7da6a466568497 (diff) | |
| download | scintilla-mirror-212257e28c87cd6ed2ff244ee6518be0c73fa342.tar.gz | |
Added setting for font quality to allow application to choose anti-aliased,
non-anti-aliased or lcd-optimized text.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 9 | ||||
| -rw-r--r-- | src/FontQuality.h | 12 | ||||
| -rw-r--r-- | src/Style.cxx | 2 | ||||
| -rw-r--r-- | src/Style.h | 2 | ||||
| -rw-r--r-- | src/ViewStyle.cxx | 2 | ||||
| -rw-r--r-- | src/ViewStyle.h | 2 | 
6 files changed, 25 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 727429921..a68046b90 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7001,6 +7001,15 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  		InvalidateStyleRedraw();  		break; +	case SCI_SETFONTQUALITY: +		vs.extraFontFlag &= ~SC_EFF_QUALITY_MASK; +		vs.extraFontFlag |= (wParam & SC_EFF_QUALITY_MASK); +		InvalidateStyleRedraw(); +		break; + +	case SCI_GETFONTQUALITY: +		return (vs.extraFontFlag & SC_EFF_QUALITY_MASK); +  	case SCI_SETTABWIDTH:  		if (wParam > 0) {  			pdoc->tabInChars = wParam; diff --git a/src/FontQuality.h b/src/FontQuality.h new file mode 100644 index 000000000..2c8d548a8 --- /dev/null +++ b/src/FontQuality.h @@ -0,0 +1,12 @@ +// Scintilla source code edit control +/** @file FontQuality.h + ** Definitions to control font anti-aliasing. + **/ +// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org> +// The License.txt file describes the conditions under which this software may be distributed. + +#define SC_EFF_QUALITY_MASK            0xF +#define SC_EFF_QUALITY_DEFAULT           0 +#define SC_EFF_QUALITY_NON_ANTIALIASED   1 +#define SC_EFF_QUALITY_ANTIALIASED       2 +#define SC_EFF_QUALITY_LCD_OPTIMIZED     3 diff --git a/src/Style.cxx b/src/Style.cxx index ad081a66d..4314dec0a 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -126,7 +126,7 @@ bool Style::EquivalentFontTo(const Style *other) const {  	return strcmp(fontName, other->fontName) == 0;  } -void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle, bool extraFontFlag) { +void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle, int extraFontFlag) {  	sizeZoomed = size + zoomLevel;  	if (sizeZoomed <= 2)	// Hangs if sizeZoomed <= 1  		sizeZoomed = 2; diff --git a/src/Style.h b/src/Style.h index 1caecaee7..0be3d4f07 100644 --- a/src/Style.h +++ b/src/Style.h @@ -53,7 +53,7 @@ public:  		   bool visible_, bool changeable_, bool hotspot_);  	void ClearTo(const Style &source);  	bool EquivalentFontTo(const Style *other) const; -	void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0, bool extraFontFlag = false); +	void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0, int extraFontFlag = 0);  	bool IsProtected() const { return !(changeable && visible);};  }; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 3dff07b9b..8e9c4a463 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -247,7 +247,7 @@ void ViewStyle::Init(size_t stylesSize_) {  	viewIndentationGuides = ivNone;  	viewEOL = false;  	showMarkedLines = true; -	extraFontFlag = false; +	extraFontFlag = 0;  	extraAscent = 0;  	extraDescent = 0;  	marginStyleOffset = 0; diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 1a85cf43f..22e365b02 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -106,7 +106,7 @@ public:  	int caretStyle;  	int caretWidth;  	bool someStylesProtected; -	bool extraFontFlag; +	int extraFontFlag;  	int extraAscent;  	int extraDescent;  	int marginStyleOffset;  | 
