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:
@@ -284,7 +284,7 @@ public:
|
|||||||
Font();
|
Font();
|
||||||
virtual ~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();
|
virtual void Release();
|
||||||
|
|
||||||
FontID GetID() { return id; }
|
FontID GetID() { return id; }
|
||||||
|
@@ -122,7 +122,7 @@ bool Style::EquivalentFontTo(const Style *other) const {
|
|||||||
return strcmp(fontName, other->fontName) == 0;
|
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;
|
sizeZoomed = size + zoomLevel;
|
||||||
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
|
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
|
||||||
sizeZoomed = 2;
|
sizeZoomed = 2;
|
||||||
@@ -137,7 +137,7 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) {
|
|||||||
if (aliasOfDefaultFont) {
|
if (aliasOfDefaultFont) {
|
||||||
font.SetID(defaultStyle->font.GetID());
|
font.SetID(defaultStyle->font.GetID());
|
||||||
} else if (fontName) {
|
} else if (fontName) {
|
||||||
font.Create(fontName, characterSet, deviceHeight, bold, italic);
|
font.Create(fontName, characterSet, deviceHeight, bold, italic, extraFontFlag);
|
||||||
} else {
|
} else {
|
||||||
font.SetID(0);
|
font.SetID(0);
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ public:
|
|||||||
bool visible_, bool changeable_, bool hotspot_);
|
bool visible_, bool changeable_, bool hotspot_);
|
||||||
void ClearTo(const Style &source);
|
void ClearTo(const Style &source);
|
||||||
bool EquivalentFontTo(const Style *other) const;
|
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);};
|
bool IsProtected() const { return !(changeable && visible);};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -111,6 +111,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
|
|||||||
viewIndentationGuides = source.viewIndentationGuides;
|
viewIndentationGuides = source.viewIndentationGuides;
|
||||||
viewEOL = source.viewEOL;
|
viewEOL = source.viewEOL;
|
||||||
showMarkedLines = source.showMarkedLines;
|
showMarkedLines = source.showMarkedLines;
|
||||||
|
extraFontFlag = source.extraFontFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewStyle::~ViewStyle() {
|
ViewStyle::~ViewStyle() {
|
||||||
@@ -192,6 +193,7 @@ void ViewStyle::Init() {
|
|||||||
viewIndentationGuides = false;
|
viewIndentationGuides = false;
|
||||||
viewEOL = false;
|
viewEOL = false;
|
||||||
showMarkedLines = true;
|
showMarkedLines = true;
|
||||||
|
extraFontFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
||||||
@@ -227,13 +229,13 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
|||||||
void ViewStyle::Refresh(Surface &surface) {
|
void ViewStyle::Refresh(Surface &surface) {
|
||||||
selbar.desired = Platform::Chrome();
|
selbar.desired = Platform::Chrome();
|
||||||
selbarlight.desired = Platform::ChromeHighlight();
|
selbarlight.desired = Platform::ChromeHighlight();
|
||||||
styles[STYLE_DEFAULT].Realise(surface, zoomLevel);
|
styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag);
|
||||||
maxAscent = styles[STYLE_DEFAULT].ascent;
|
maxAscent = styles[STYLE_DEFAULT].ascent;
|
||||||
maxDescent = styles[STYLE_DEFAULT].descent;
|
maxDescent = styles[STYLE_DEFAULT].descent;
|
||||||
someStylesProtected = false;
|
someStylesProtected = false;
|
||||||
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
|
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
|
||||||
if (i != STYLE_DEFAULT) {
|
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)
|
if (maxAscent < styles[i].ascent)
|
||||||
maxAscent = styles[i].ascent;
|
maxAscent = styles[i].ascent;
|
||||||
if (maxDescent < styles[i].descent)
|
if (maxDescent < styles[i].descent)
|
||||||
|
@@ -89,7 +89,8 @@ public:
|
|||||||
int edgeState;
|
int edgeState;
|
||||||
int caretWidth;
|
int caretWidth;
|
||||||
bool someStylesProtected;
|
bool someStylesProtected;
|
||||||
|
bool extraFontFlag;
|
||||||
|
|
||||||
ViewStyle();
|
ViewStyle();
|
||||||
ViewStyle(const ViewStyle &source);
|
ViewStyle(const ViewStyle &source);
|
||||||
~ViewStyle();
|
~ViewStyle();
|
||||||
|
@@ -284,7 +284,7 @@ public:
|
|||||||
Font();
|
Font();
|
||||||
virtual ~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();
|
virtual void Release();
|
||||||
|
|
||||||
FontID GetID() { return id; }
|
FontID GetID() { return id; }
|
||||||
|
@@ -122,7 +122,7 @@ bool Style::EquivalentFontTo(const Style *other) const {
|
|||||||
return strcmp(fontName, other->fontName) == 0;
|
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;
|
sizeZoomed = size + zoomLevel;
|
||||||
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
|
if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1
|
||||||
sizeZoomed = 2;
|
sizeZoomed = 2;
|
||||||
@@ -137,7 +137,7 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) {
|
|||||||
if (aliasOfDefaultFont) {
|
if (aliasOfDefaultFont) {
|
||||||
font.SetID(defaultStyle->font.GetID());
|
font.SetID(defaultStyle->font.GetID());
|
||||||
} else if (fontName) {
|
} else if (fontName) {
|
||||||
font.Create(fontName, characterSet, deviceHeight, bold, italic);
|
font.Create(fontName, characterSet, deviceHeight, bold, italic, extraFontFlag);
|
||||||
} else {
|
} else {
|
||||||
font.SetID(0);
|
font.SetID(0);
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ public:
|
|||||||
bool visible_, bool changeable_, bool hotspot_);
|
bool visible_, bool changeable_, bool hotspot_);
|
||||||
void ClearTo(const Style &source);
|
void ClearTo(const Style &source);
|
||||||
bool EquivalentFontTo(const Style *other) const;
|
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);};
|
bool IsProtected() const { return !(changeable && visible);};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -111,6 +111,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
|
|||||||
viewIndentationGuides = source.viewIndentationGuides;
|
viewIndentationGuides = source.viewIndentationGuides;
|
||||||
viewEOL = source.viewEOL;
|
viewEOL = source.viewEOL;
|
||||||
showMarkedLines = source.showMarkedLines;
|
showMarkedLines = source.showMarkedLines;
|
||||||
|
extraFontFlag = source.extraFontFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewStyle::~ViewStyle() {
|
ViewStyle::~ViewStyle() {
|
||||||
@@ -192,6 +193,7 @@ void ViewStyle::Init() {
|
|||||||
viewIndentationGuides = false;
|
viewIndentationGuides = false;
|
||||||
viewEOL = false;
|
viewEOL = false;
|
||||||
showMarkedLines = true;
|
showMarkedLines = true;
|
||||||
|
extraFontFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
||||||
@@ -227,13 +229,13 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
|||||||
void ViewStyle::Refresh(Surface &surface) {
|
void ViewStyle::Refresh(Surface &surface) {
|
||||||
selbar.desired = Platform::Chrome();
|
selbar.desired = Platform::Chrome();
|
||||||
selbarlight.desired = Platform::ChromeHighlight();
|
selbarlight.desired = Platform::ChromeHighlight();
|
||||||
styles[STYLE_DEFAULT].Realise(surface, zoomLevel);
|
styles[STYLE_DEFAULT].Realise(surface, zoomLevel, NULL, extraFontFlag);
|
||||||
maxAscent = styles[STYLE_DEFAULT].ascent;
|
maxAscent = styles[STYLE_DEFAULT].ascent;
|
||||||
maxDescent = styles[STYLE_DEFAULT].descent;
|
maxDescent = styles[STYLE_DEFAULT].descent;
|
||||||
someStylesProtected = false;
|
someStylesProtected = false;
|
||||||
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
|
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
|
||||||
if (i != STYLE_DEFAULT) {
|
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)
|
if (maxAscent < styles[i].ascent)
|
||||||
maxAscent = styles[i].ascent;
|
maxAscent = styles[i].ascent;
|
||||||
if (maxDescent < styles[i].descent)
|
if (maxDescent < styles[i].descent)
|
||||||
|
@@ -89,7 +89,8 @@ public:
|
|||||||
int edgeState;
|
int edgeState;
|
||||||
int caretWidth;
|
int caretWidth;
|
||||||
bool someStylesProtected;
|
bool someStylesProtected;
|
||||||
|
bool extraFontFlag;
|
||||||
|
|
||||||
ViewStyle();
|
ViewStyle();
|
||||||
ViewStyle(const ViewStyle &source);
|
ViewStyle(const ViewStyle &source);
|
||||||
~ViewStyle();
|
~ViewStyle();
|
||||||
|
Reference in New Issue
Block a user