]> git.saurik.com Git - wxWidgets.git/commitdiff
[wxGTK2] Move wxFontRefData::SetPointSize to wxNativeFontInfo. Implement SetFaceName()
authorMart Raudsepp <leio@gentoo.org>
Tue, 23 Aug 2005 00:03:27 +0000 (00:03 +0000)
committerMart Raudsepp <leio@gentoo.org>
Tue, 23 Aug 2005 00:03:27 +0000 (00:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/font.cpp
src/gtk1/font.cpp
src/unix/fontutil.cpp

index fd221b789fa208e9484eb1e29eceb5374b71a121..9e42fdf9e68dac95c6faefe00232cbae0d7dd275 100644 (file)
@@ -464,10 +464,7 @@ void wxFontRefData::SetPointSize(int pointSize)
     m_pointSize = pointSize;
 
 #ifdef __WXGTK20__
     m_pointSize = pointSize;
 
 #ifdef __WXGTK20__
-    // Get native info
-    PangoFontDescription *desc = m_nativeFontInfo.description;
-
-    pango_font_description_set_size( desc, m_pointSize * PANGO_SCALE );
+    m_nativeFontInfo.SetPointSize(pointSize);
 #else
     if ( HasNativeFont() )
     {
 #else
     if ( HasNativeFont() )
     {
@@ -567,7 +564,9 @@ void wxFontRefData::SetFaceName(const wxString& facename)
 {
     m_faceName = facename;
 
 {
     m_faceName = facename;
 
-#ifndef __WXGTK20__
+#ifdef __WXGTK20__
+    m_nativeFontInfo.SetFaceName(facename);
+#else
     if ( HasNativeFont() )
     {
         m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename);
     if ( HasNativeFont() )
     {
         m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename);
index fd221b789fa208e9484eb1e29eceb5374b71a121..9e42fdf9e68dac95c6faefe00232cbae0d7dd275 100644 (file)
@@ -464,10 +464,7 @@ void wxFontRefData::SetPointSize(int pointSize)
     m_pointSize = pointSize;
 
 #ifdef __WXGTK20__
     m_pointSize = pointSize;
 
 #ifdef __WXGTK20__
-    // Get native info
-    PangoFontDescription *desc = m_nativeFontInfo.description;
-
-    pango_font_description_set_size( desc, m_pointSize * PANGO_SCALE );
+    m_nativeFontInfo.SetPointSize(pointSize);
 #else
     if ( HasNativeFont() )
     {
 #else
     if ( HasNativeFont() )
     {
@@ -567,7 +564,9 @@ void wxFontRefData::SetFaceName(const wxString& facename)
 {
     m_faceName = facename;
 
 {
     m_faceName = facename;
 
-#ifndef __WXGTK20__
+#ifdef __WXGTK20__
+    m_nativeFontInfo.SetFaceName(facename);
+#else
     if ( HasNativeFont() )
     {
         m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename);
     if ( HasNativeFont() )
     {
         m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename);
index d55aa305fae879680cea06cd8cedc2bdb3d0e296..bcabccd4b026ceb8c9f509e54147bca9741fde12 100644 (file)
@@ -202,9 +202,9 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const
 }
 
 
 }
 
 
-void wxNativeFontInfo::SetPointSize(int WXUNUSED(pointsize))
+void wxNativeFontInfo::SetPointSize(int pointsize)
 {
 {
-    wxFAIL_MSG( _T("not implemented") );
+    pango_font_description_set_size( description, pointsize * PANGO_SCALE );
 }
 
 void wxNativeFontInfo::SetStyle(wxFontStyle style)
 }
 
 void wxNativeFontInfo::SetStyle(wxFontStyle style)
@@ -249,9 +249,9 @@ void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
     wxFAIL_MSG( _T("not implemented") );
 }
 
     wxFAIL_MSG( _T("not implemented") );
 }
 
-void wxNativeFontInfo::SetFaceName(wxString WXUNUSED(facename))
+void wxNativeFontInfo::SetFaceName(wxString facename)
 {
 {
-    wxFAIL_MSG( _T("not implemented") );
+    pango_font_description_set_family( description, wxGTK_CONV(facename) );
 }
 
 void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family))
 }
 
 void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family))