From 8a15e8ba7aa7800427ac4118f434e827f33dd73a Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Tue, 23 Aug 2005 00:03:27 +0000 Subject: [PATCH] [wxGTK2] Move wxFontRefData::SetPointSize to wxNativeFontInfo. Implement SetFaceName() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/font.cpp | 9 ++++----- src/gtk1/font.cpp | 9 ++++----- src/unix/fontutil.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index fd221b789f..9e42fdf9e6 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -464,10 +464,7 @@ void wxFontRefData::SetPointSize(int pointSize) 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() ) { @@ -567,7 +564,9 @@ void wxFontRefData::SetFaceName(const wxString& facename) { m_faceName = facename; -#ifndef __WXGTK20__ +#ifdef __WXGTK20__ + m_nativeFontInfo.SetFaceName(facename); +#else if ( HasNativeFont() ) { m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename); diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index fd221b789f..9e42fdf9e6 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -464,10 +464,7 @@ void wxFontRefData::SetPointSize(int pointSize) 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() ) { @@ -567,7 +564,9 @@ void wxFontRefData::SetFaceName(const wxString& facename) { m_faceName = facename; -#ifndef __WXGTK20__ +#ifdef __WXGTK20__ + m_nativeFontInfo.SetFaceName(facename); +#else if ( HasNativeFont() ) { m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename); diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index d55aa305fa..bcabccd4b0 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -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) @@ -249,9 +249,9 @@ void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined)) 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))