+ m_nativeFontInfo.SetXFontComponent(wxXLFD_POINTSIZE, size);
+ }
+#endif
+}
+
+void wxFontRefData::SetFamily(int family)
+{
+ m_family = family;
+
+ // TODO: what are we supposed to do with m_nativeFontInfo here?
+}
+
+void wxFontRefData::SetStyle(int style)
+{
+ m_style = style;
+
+#ifdef __WXGTK20__
+ // Get native info
+ PangoFontDescription *desc = m_nativeFontInfo.description;
+
+ switch ( style )
+ {
+ case wxFONTSTYLE_ITALIC:
+ pango_font_description_set_style( desc, PANGO_STYLE_ITALIC );
+ break;
+ case wxFONTSTYLE_SLANT:
+ pango_font_description_set_style( desc, PANGO_STYLE_OBLIQUE );
+ break;
+ default:
+ wxFAIL_MSG( _T("unknown font style") );
+ // fall through
+ case wxFONTSTYLE_NORMAL:
+ pango_font_description_set_style( desc, PANGO_STYLE_NORMAL );
+ break;
+ }
+#else
+ if ( HasNativeFont() )
+ {
+ wxString slant;
+ switch ( style )
+ {
+ case wxFONTSTYLE_ITALIC:
+ slant = _T('i');
+ break;
+
+ case wxFONTSTYLE_SLANT:
+ slant = _T('o');
+ break;
+
+ default:
+ wxFAIL_MSG( _T("unknown font style") );
+ // fall through
+
+ case wxFONTSTYLE_NORMAL:
+ slant = _T('r');
+ }
+
+ m_nativeFontInfo.SetXFontComponent(wxXLFD_SLANT, slant);
+ }
+#endif
+}
+
+void wxFontRefData::SetWeight(int weight)
+{
+ m_weight = weight;
+
+#ifdef __WXGTK20__
+ PangoFontDescription *desc = m_nativeFontInfo.description;
+ switch ( weight )
+ {
+ case wxFONTWEIGHT_BOLD:
+ pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
+ break;
+
+ case wxFONTWEIGHT_LIGHT:
+ pango_font_description_set_weight(desc, PANGO_WEIGHT_LIGHT);
+ break;
+
+ default:
+ wxFAIL_MSG( _T("unknown font weight") );
+ // fall through
+
+ case wxFONTWEIGHT_NORMAL:
+ // unspecified
+ pango_font_description_set_weight(desc, PANGO_WEIGHT_NORMAL);
+ }
+#else //!__WXGTK20__
+ if ( HasNativeFont() )
+ {
+ wxString boldness;
+ switch ( weight )
+ {
+ case wxFONTWEIGHT_BOLD:
+ boldness = _T("bold");
+ break;
+
+ case wxFONTWEIGHT_LIGHT:
+ boldness = _T("light");
+ break;
+
+ default:
+ wxFAIL_MSG( _T("unknown font weight") );
+ // fall through
+
+ case wxFONTWEIGHT_NORMAL:
+ // unspecified
+ boldness = _T("medium");
+ }
+
+ m_nativeFontInfo.SetXFontComponent(wxXLFD_WEIGHT, boldness);
+ }
+#endif