From a912ea269e7b5896f9ada678a41062ddaf18a3d9 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Wed, 25 Mar 2009 12:44:15 +0000 Subject: [PATCH] add a few comments about the fact that Get/SetNativeFontInfoUserDesc are not meant for 100%-precise serialization/deserialization of wxFont objects, at least under wxMSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/font.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/interface/wx/font.h b/interface/wx/font.h index d0f7f25ca9..2aa73fd21a 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -401,18 +401,21 @@ public: Note that the returned string is not meant to be shown or edited by the user: a typical use of this function is for serializing in string-form a wxFont object. - @see SetNativeFontInfo(),GetNativeFontInfoUserDesc() + @see SetNativeFontInfo(), GetNativeFontInfoUserDesc() */ wxString GetNativeFontInfoDesc() const; /** Returns a user-friendly string for this font object. Returned string is always non-empty. + + The string does not encode all wxFont infos under all platforms; + e.g. under wxMSW the font family is not present in the returned string. Some examples of the formats of returned strings (which are platform-dependent) are in SetNativeFontInfoUserDesc(). - @see GetNativeFontInfoDesc() + @see SetNativeFontInfoUserDesc(), GetNativeFontInfoDesc() */ wxString GetNativeFontInfoUserDesc() const; @@ -562,6 +565,12 @@ public: For more detailed information about the allowed syntaxes you can look at the documentation of the native API used for font-rendering (e.g. @c pango_font_description_from_string on GTK). + + Note that unlike SetNativeFontInfo(), this function doesn't always restore all + attributes of the wxFont object under all platforms; e.g. on wxMSW the font family + is not restored (because GetNativeFontInfoUserDesc doesn't return it on wxMSW). + If you want to serialize/deserialize a font in string form, you should use + GetNativeFontInfoDesc() and SetNativeFontInfo() instead. @see SetNativeFontInfo() */ -- 2.45.2