+void
+wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value)
+{
+ wxCHECK_RET( field < wxXLFD_MAX, _T("invalid XLFD field") );
+
+ // this class should be initialized with a valid font spec first and only
+ // then the fields may be modified!
+ wxASSERT_MSG( !IsDefault(), _T("can't modify an uninitialized XLFD") );
+
+ if ( !HasElements() )
+ {
+ // const_cast
+ if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
+ {
+ wxFAIL_MSG( _T("can't set font element for invalid XLFD") );
+
+ return;
+ }
+ }
+
+ fontElements[field] = value;
+
+ // invalidate the XFLD, it doesn't correspond to the font elements any more
+ xFontName.clear();
+}
+
+void wxNativeFontInfo::SetXFontName(const wxString& xFontName_)
+{
+ // invalidate the font elements, GetXFontComponent() will reparse the XLFD
+ fontElements[0].clear();
+
+ xFontName = xFontName_;
+
+ m_isDefault = FALSE;
+}
+