From be5b2f9f38eb13d259a525b8d78106d370e05351 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 11 Aug 2003 01:14:34 +0000 Subject: [PATCH] initialize the font fields properly when it corresponds to a native font git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/font.cpp | 12 +++++++++++- src/gtk1/font.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) 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); } } } -- 2.45.2