From 0dac661468e1b6fcea35c4f78cda7c72a5a6c1c6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Mar 2022 22:57:45 +0100 Subject: [PATCH] Fix wxDC::SetFont() documentation Don't say that passing wxNullFont to it is allowed because it isn't neither in wxGTK nor in wxOSX and also remove the part about destroying the previous font because we hadn't had to destroy the fonts explicitly since 25 years. Still document that setting an invalid font works in wxMSW, but explain that doing this is not a good idea. --- interface/wx/dc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 0af532697b..100d8bfbaa 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -1155,9 +1155,10 @@ public: /** Sets the current font for the DC. - If the argument is ::wxNullFont (or another invalid font; see wxFont::IsOk), - the current font is selected out of the device context (leaving wxDC without - any valid font), allowing the current font to be destroyed safely. + The @a font parameter should be valid, although in wxMSW port (only) + the argument ::wxNullFont is also accepted and resets the device + context font to the default value used by the system (which is not + generally useful). @see wxFont */