diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 23a8b2b1f0..e2eefe6335 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -232,8 +232,15 @@ void wxFontRefData::InitFromNative() // init fields m_faceName = wxGTK_CONV_BACK( pango_font_description_get_family( desc ) ); + + // Pango sometimes needs to have a size + int pango_size = pango_font_description_get_size( desc ); + if (pango_size == 0) + pango_font_description_set_size( desc, 12 * PANGO_SCALE); m_pointSize = pango_font_description_get_size( desc ) / PANGO_SCALE; + + // wxPrintf( wxT("face %s m_pointSize %d\n"), m_faceName.c_str(), m_pointSize ); switch (pango_font_description_get_style( desc )) { diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 23a8b2b1f0..e2eefe6335 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -232,8 +232,15 @@ void wxFontRefData::InitFromNative() // init fields m_faceName = wxGTK_CONV_BACK( pango_font_description_get_family( desc ) ); + + // Pango sometimes needs to have a size + int pango_size = pango_font_description_get_size( desc ); + if (pango_size == 0) + pango_font_description_set_size( desc, 12 * PANGO_SCALE); m_pointSize = pango_font_description_get_size( desc ) / PANGO_SCALE; + + // wxPrintf( wxT("face %s m_pointSize %d\n"), m_faceName.c_str(), m_pointSize ); switch (pango_font_description_get_style( desc )) { diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 3474da8048..5cb29cba4f 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -139,7 +139,7 @@ bool wxNativeFontInfo::FromString( const wxString& str ) description = pango_font_description_from_string( wxGTK_CONV( str ) ); - // wxPrintf( L"FromString result: %s\n", ToString().c_str() ); + // wxPrintf( L"FromString before: %s result: %s\n", str.c_str(), ToString().c_str() ); return TRUE; }