diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 9987e141cc..1047a2f503 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -86,6 +86,9 @@ public: #endif // GTK 2.0/1.x } + // reinitilize the font with the gived XFLD + void ReInit(const wxString& fontname); + // setters: all of them also take care to modify m_nativeFontInfo if we // have it so as to not lose the information not carried by our fields void SetPointSize(int pointSize); @@ -437,6 +440,13 @@ wxFontRefData::wxFontRefData(const wxString& fontname) InitFromNative(); } +void wxFontRefData::ReInit(const wxString& fontname) +{ + m_nativeFontInfo.SetXFontName(fontname); + + InitFromNative(); +} + void wxFontRefData::ClearGdkFonts() { #ifndef __WXGTK20__ @@ -952,7 +962,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const &xfontname); if ( font ) { - M_FONTDATA->m_nativeFontInfo.SetXFontName(xfontname); + M_FONTDATA->m_nativeFontInfo.ReInit(xfontname); } } } diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 9987e141cc..1047a2f503 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -86,6 +86,9 @@ public: #endif // GTK 2.0/1.x } + // reinitilize the font with the gived XFLD + void ReInit(const wxString& fontname); + // setters: all of them also take care to modify m_nativeFontInfo if we // have it so as to not lose the information not carried by our fields void SetPointSize(int pointSize); @@ -437,6 +440,13 @@ wxFontRefData::wxFontRefData(const wxString& fontname) InitFromNative(); } +void wxFontRefData::ReInit(const wxString& fontname) +{ + m_nativeFontInfo.SetXFontName(fontname); + + InitFromNative(); +} + void wxFontRefData::ClearGdkFonts() { #ifndef __WXGTK20__ @@ -952,7 +962,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const &xfontname); if ( font ) { - M_FONTDATA->m_nativeFontInfo.SetXFontName(xfontname); + M_FONTDATA->m_nativeFontInfo.ReInit(xfontname); } } }