From: Robin Dunn Date: Wed, 11 Feb 2004 22:35:11 +0000 (+0000) Subject: Allow an extra flag to be given to Font::Create X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e0e5663fe4c8771d7e5d0c212fcf3f6cd9b1a37f Allow an extra flag to be given to Font::Create git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/stc/scintilla/include/Platform.h b/contrib/src/stc/scintilla/include/Platform.h index 8764024168..279a3df3ed 100644 --- a/contrib/src/stc/scintilla/include/Platform.h +++ b/contrib/src/stc/scintilla/include/Platform.h @@ -284,7 +284,7 @@ public: Font(); virtual ~Font(); - virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic); + virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic, bool extraFontFlag=false); virtual void Release(); FontID GetID() { return id; } diff --git a/contrib/src/stc/scintilla/src/Style.cxx b/contrib/src/stc/scintilla/src/Style.cxx index c37bcac900..2aea5fef98 100644 --- a/contrib/src/stc/scintilla/src/Style.cxx +++ b/contrib/src/stc/scintilla/src/Style.cxx @@ -122,7 +122,7 @@ bool Style::EquivalentFontTo(const Style *other) const { return strcmp(fontName, other->fontName) == 0; } -void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) { +void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle, bool extraFontFlag) { sizeZoomed = size + zoomLevel; if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 sizeZoomed = 2; @@ -137,7 +137,7 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) { if (aliasOfDefaultFont) { font.SetID(defaultStyle->font.GetID()); } else if (fontName) { - font.Create(fontName, characterSet, deviceHeight, bold, italic); + font.Create(fontName, characterSet, deviceHeight, bold, italic, extraFontFlag); } else { font.SetID(0); } diff --git a/contrib/src/stc/scintilla/src/Style.h b/contrib/src/stc/scintilla/src/Style.h index 6ee930b6bb..bb94c25ef5 100644 --- a/contrib/src/stc/scintilla/src/Style.h +++ b/contrib/src/stc/scintilla/src/Style.h @@ -49,7 +49,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); + void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0, bool extraFontFlag = false); bool IsProtected() const { return !(changeable && visible);}; }; diff --git a/contrib/src/stc/scintilla/src/ViewStyle.cxx b/contrib/src/stc/scintilla/src/ViewStyle.cxx index e2a65e09e4..80e8fc8a0d 100644 --- a/contrib/src/stc/scintilla/src/ViewStyle.cxx +++ b/contrib/src/stc/scintilla/src/ViewStyle.cxx @@ -111,6 +111,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) { viewIndentationGuides = source.viewIndentationGuides; viewEOL = source.viewEOL; showMarkedLines = source.showMarkedLines; + extraFontFlag = source.extraFontFlag; } ViewStyle::~ViewStyle() { @@ -192,6 +193,7 @@ void ViewStyle::Init() { viewIndentationGuides = false; viewEOL = false; showMarkedLines = true; + extraFontFlag = false; } void ViewStyle::RefreshColourPalette(Palette &pal, bool want) { @@ -227,13 +229,13 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) { void ViewStyle::Refresh(Surface &surface) { selbar.desired = Platform::Chrome(); selbarlight.desired = Platform::ChromeHighlight(); - styles[STYLE_DEFAULT].Realise(surface, zoomLevel); + styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag); maxAscent = styles[STYLE_DEFAULT].ascent; maxDescent = styles[STYLE_DEFAULT].descent; someStylesProtected = false; for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) { if (i != STYLE_DEFAULT) { - styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT]); + styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT], extraFontFlag); if (maxAscent < styles[i].ascent) maxAscent = styles[i].ascent; if (maxDescent < styles[i].descent) diff --git a/contrib/src/stc/scintilla/src/ViewStyle.h b/contrib/src/stc/scintilla/src/ViewStyle.h index 5f27cc08cb..79d885fd9f 100644 --- a/contrib/src/stc/scintilla/src/ViewStyle.h +++ b/contrib/src/stc/scintilla/src/ViewStyle.h @@ -89,7 +89,8 @@ public: int edgeState; int caretWidth; bool someStylesProtected; - + bool extraFontFlag; + ViewStyle(); ViewStyle(const ViewStyle &source); ~ViewStyle(); diff --git a/src/stc/scintilla/include/Platform.h b/src/stc/scintilla/include/Platform.h index 8764024168..279a3df3ed 100644 --- a/src/stc/scintilla/include/Platform.h +++ b/src/stc/scintilla/include/Platform.h @@ -284,7 +284,7 @@ public: Font(); virtual ~Font(); - virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic); + virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic, bool extraFontFlag=false); virtual void Release(); FontID GetID() { return id; } diff --git a/src/stc/scintilla/src/Style.cxx b/src/stc/scintilla/src/Style.cxx index c37bcac900..2aea5fef98 100644 --- a/src/stc/scintilla/src/Style.cxx +++ b/src/stc/scintilla/src/Style.cxx @@ -122,7 +122,7 @@ bool Style::EquivalentFontTo(const Style *other) const { return strcmp(fontName, other->fontName) == 0; } -void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) { +void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle, bool extraFontFlag) { sizeZoomed = size + zoomLevel; if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 sizeZoomed = 2; @@ -137,7 +137,7 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) { if (aliasOfDefaultFont) { font.SetID(defaultStyle->font.GetID()); } else if (fontName) { - font.Create(fontName, characterSet, deviceHeight, bold, italic); + font.Create(fontName, characterSet, deviceHeight, bold, italic, extraFontFlag); } else { font.SetID(0); } diff --git a/src/stc/scintilla/src/Style.h b/src/stc/scintilla/src/Style.h index 6ee930b6bb..bb94c25ef5 100644 --- a/src/stc/scintilla/src/Style.h +++ b/src/stc/scintilla/src/Style.h @@ -49,7 +49,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); + void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0, bool extraFontFlag = false); bool IsProtected() const { return !(changeable && visible);}; }; diff --git a/src/stc/scintilla/src/ViewStyle.cxx b/src/stc/scintilla/src/ViewStyle.cxx index e2a65e09e4..80e8fc8a0d 100644 --- a/src/stc/scintilla/src/ViewStyle.cxx +++ b/src/stc/scintilla/src/ViewStyle.cxx @@ -111,6 +111,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) { viewIndentationGuides = source.viewIndentationGuides; viewEOL = source.viewEOL; showMarkedLines = source.showMarkedLines; + extraFontFlag = source.extraFontFlag; } ViewStyle::~ViewStyle() { @@ -192,6 +193,7 @@ void ViewStyle::Init() { viewIndentationGuides = false; viewEOL = false; showMarkedLines = true; + extraFontFlag = false; } void ViewStyle::RefreshColourPalette(Palette &pal, bool want) { @@ -227,13 +229,13 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) { void ViewStyle::Refresh(Surface &surface) { selbar.desired = Platform::Chrome(); selbarlight.desired = Platform::ChromeHighlight(); - styles[STYLE_DEFAULT].Realise(surface, zoomLevel); + styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag); maxAscent = styles[STYLE_DEFAULT].ascent; maxDescent = styles[STYLE_DEFAULT].descent; someStylesProtected = false; for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) { if (i != STYLE_DEFAULT) { - styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT]); + styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT], extraFontFlag); if (maxAscent < styles[i].ascent) maxAscent = styles[i].ascent; if (maxDescent < styles[i].descent) diff --git a/src/stc/scintilla/src/ViewStyle.h b/src/stc/scintilla/src/ViewStyle.h index 5f27cc08cb..79d885fd9f 100644 --- a/src/stc/scintilla/src/ViewStyle.h +++ b/src/stc/scintilla/src/ViewStyle.h @@ -89,7 +89,8 @@ public: int edgeState; int caretWidth; bool someStylesProtected; - + bool extraFontFlag; + ViewStyle(); ViewStyle(const ViewStyle &source); ~ViewStyle();