]> git.saurik.com Git - wxWidgets.git/commitdiff
initialize the font fields properly when it corresponds to a native font
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Aug 2003 01:14:34 +0000 (01:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Aug 2003 01:14:34 +0000 (01:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/font.cpp
src/gtk1/font.cpp

index 9987e141cc4c94335a1d83301f067c44dd96c8f2..1047a2f5033f9a016413e3cfe1ff616fb95e181d 100644 (file)
@@ -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);
                 }
             }
         }
index 9987e141cc4c94335a1d83301f067c44dd96c8f2..1047a2f5033f9a016413e3cfe1ff616fb95e181d 100644 (file)
@@ -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);
                 }
             }
         }