Ensure that the native font is initialized so the face name and such
are valid git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
917d18aadb
commit
7475e81462
@ -475,7 +475,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@ -858,7 +858,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
@ -2037,6 +2037,11 @@ void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
|
|||||||
// Set style size, face, bold, italic, and underline attributes from
|
// Set style size, face, bold, italic, and underline attributes from
|
||||||
// a wxFont's attributes.
|
// a wxFont's attributes.
|
||||||
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Ensure that the native font is initialized
|
||||||
|
int x, y;
|
||||||
|
GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font);
|
||||||
|
#endif
|
||||||
int size = font.GetPointSize();
|
int size = font.GetPointSize();
|
||||||
wxString faceName = font.GetFaceName();
|
wxString faceName = font.GetFaceName();
|
||||||
bool bold = font.GetWeight() == wxBOLD;
|
bool bold = font.GetWeight() == wxBOLD;
|
||||||
|
@ -242,6 +242,11 @@ void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
|
|||||||
// Set style size, face, bold, italic, and underline attributes from
|
// Set style size, face, bold, italic, and underline attributes from
|
||||||
// a wxFont's attributes.
|
// a wxFont's attributes.
|
||||||
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Ensure that the native font is initialized
|
||||||
|
int x, y;
|
||||||
|
GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font);
|
||||||
|
#endif
|
||||||
int size = font.GetPointSize();
|
int size = font.GetPointSize();
|
||||||
wxString faceName = font.GetFaceName();
|
wxString faceName = font.GetFaceName();
|
||||||
bool bold = font.GetWeight() == wxBOLD;
|
bool bold = font.GetWeight() == wxBOLD;
|
||||||
|
@ -475,7 +475,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@ -858,7 +858,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
@ -2037,6 +2037,11 @@ void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
|
|||||||
// Set style size, face, bold, italic, and underline attributes from
|
// Set style size, face, bold, italic, and underline attributes from
|
||||||
// a wxFont's attributes.
|
// a wxFont's attributes.
|
||||||
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Ensure that the native font is initialized
|
||||||
|
int x, y;
|
||||||
|
GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font);
|
||||||
|
#endif
|
||||||
int size = font.GetPointSize();
|
int size = font.GetPointSize();
|
||||||
wxString faceName = font.GetFaceName();
|
wxString faceName = font.GetFaceName();
|
||||||
bool bold = font.GetWeight() == wxBOLD;
|
bool bold = font.GetWeight() == wxBOLD;
|
||||||
|
@ -242,6 +242,11 @@ void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
|
|||||||
// Set style size, face, bold, italic, and underline attributes from
|
// Set style size, face, bold, italic, and underline attributes from
|
||||||
// a wxFont's attributes.
|
// a wxFont's attributes.
|
||||||
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Ensure that the native font is initialized
|
||||||
|
int x, y;
|
||||||
|
GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font);
|
||||||
|
#endif
|
||||||
int size = font.GetPointSize();
|
int size = font.GetPointSize();
|
||||||
wxString faceName = font.GetFaceName();
|
wxString faceName = font.GetFaceName();
|
||||||
bool bold = font.GetWeight() == wxBOLD;
|
bool bold = font.GetWeight() == wxBOLD;
|
||||||
|
Loading…
Reference in New Issue
Block a user