bool wxNativeFontInfo::FromString(const wxString& s)
{
- xFontName = s;
+ wxStringTokenizer tokenizer(s, _T(";"));
+
+ wxString token = tokenizer.GetNextToken();
+ //
+ // Ignore the version for now
+ //
+
+ xFontName = tokenizer.GetNextToken();
+ if(!xFontName)
+ return FALSE;
+
return TRUE;
}
wxString wxNativeFontInfo::ToString() const
{
- return xFontName;
+ wxString s;
+
+ s.Printf("%d;%s",
+ 0, // version
+ xFontName.c_str());
+
+ return s;
}
// ----------------------------------------------------------------------------
{
Init();
- Create(info.ToString());
+ Create(info.xFontName);
}
bool wxFont::Create(const wxNativeFontInfo& info)
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
{
- Init();
-
if( !fontname )
{
*this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);