These suffixes don't make part of the face name in wx API but the native MSW
API which we use since r62675 does return them. This made the unit test fail
in SettingsTestCase::GlobalFonts() as a face name with such suffix wasn't
recognized as a valid face name any more, so simply remove them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62708
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
facename = GetMSWFaceName();
if ( !facename.empty() )
{
+ // the face name returned by GetOutlineTextMetrics() may have
+ // these suffixes which we don't count as part of face name
+ // because we have separate fields for them so remove them
+ wxString basename;
+ if ( facename.EndsWith(wxS(" Italic"), &basename) ||
+ facename.EndsWith(wxS(" Bold"), &basename) )
+ facename = basename;
+
// cache the face name, it shouldn't change unless the family
// does and wxNativeFontInfo::SetFamily() resets the face name
const_cast<wxFontRefData *>(this)->SetFaceName(facename);