always transfer font family (#23158)

see #23144

only doing this when no font name was given lead to a test failure in richtextctrltest.cpp RichTextCtrlTestCase::Font
This commit is contained in:
Stefan Csomor 2023-01-19 14:20:31 +01:00 committed by GitHub
parent 08301b1b4a
commit a8937c394d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,15 +258,13 @@ wxFontRefData::wxFontRefData(const wxFontInfo& info)
{
m_info.Init();
wxFontFamily family = info.GetFamily();
if (family == wxFONTFAMILY_DEFAULT)
family = wxFONTFAMILY_SWISS;
SetFamily(family);
if ( info.HasFaceName() )
SetFaceName(info.GetFaceName());
else
{
wxFontFamily family = info.GetFamily();
if (family == wxFONTFAMILY_DEFAULT)
family = wxFONTFAMILY_SWISS;
SetFamily(family);
}
m_info.SetSizeOrDefault(info.GetFractionalPointSize());
SetNumericWeight(info.GetNumericWeight());