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
This commit is contained in:
Robin Dunn 2004-02-11 22:35:11 +00:00
parent 75c60b3e65
commit e0e5663fe4
10 changed files with 20 additions and 14 deletions

View File

@ -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; }

View File

@ -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);
}

View File

@ -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);};
};

View File

@ -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)

View File

@ -89,7 +89,8 @@ public:
int edgeState;
int caretWidth;
bool someStylesProtected;
bool extraFontFlag;
ViewStyle();
ViewStyle(const ViewStyle &source);
~ViewStyle();

View File

@ -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; }

View File

@ -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);
}

View File

@ -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);};
};

View File

@ -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)

View File

@ -89,7 +89,8 @@ public:
int edgeState;
int caretWidth;
bool someStylesProtected;
bool extraFontFlag;
ViewStyle();
ViewStyle(const ViewStyle &source);
~ViewStyle();