Font is only non default if it has non default field values.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -376,6 +376,9 @@ bool wxNativeFontInfo::FromXFontName(const wxString& fontname)
|
|||||||
// TODO: we should be able to handle the font aliases here, but how?
|
// TODO: we should be able to handle the font aliases here, but how?
|
||||||
wxStringTokenizer tokenizer(fontname, _T("-"));
|
wxStringTokenizer tokenizer(fontname, _T("-"));
|
||||||
|
|
||||||
|
// we're not initialized yet.
|
||||||
|
m_isDefault = TRUE;
|
||||||
|
|
||||||
// skip the leading, usually empty field (font name registry)
|
// skip the leading, usually empty field (font name registry)
|
||||||
if ( !tokenizer.HasMoreTokens() )
|
if ( !tokenizer.HasMoreTokens() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -389,17 +392,20 @@ bool wxNativeFontInfo::FromXFontName(const wxString& fontname)
|
|||||||
// not enough elements in the XLFD - or maybe an alias
|
// not enough elements in the XLFD - or maybe an alias
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString field = tokenizer.GetNextToken();
|
||||||
|
if (!field.empty() && field != _T('*')) {
|
||||||
|
// we're really initialized now
|
||||||
|
m_isDefault = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
fontElements[n] = tokenizer.GetNextToken();
|
fontElements[n] = field;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should be all
|
// this should be all
|
||||||
if ( tokenizer.HasMoreTokens() )
|
if ( tokenizer.HasMoreTokens() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// we're initialized now
|
|
||||||
m_isDefault = FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user