+ // default ctor (default copy ctor is ok)
+ wxNativeFontInfo() { Init(); }
+
+#if wxUSE_PANGO
+private:
+ void Init(const wxNativeFontInfo& info);
+ void Free();
+
+public:
+ wxNativeFontInfo(const wxNativeFontInfo& info) { Init(info); }
+ ~wxNativeFontInfo() { Free(); }
+
+ wxNativeFontInfo& operator=(const wxNativeFontInfo& info)
+ {
+ if (this != &info)
+ {
+ Free();
+ Init(info);
+ }
+ return *this;
+ }
+#endif // wxUSE_PANGO
+
+ // reset to the default state
+ void Init();
+
+ // init with the parameters of the given font
+ void InitFromFont(const wxFont& font)
+ {
+ // translate all font parameters
+ SetStyle((wxFontStyle)font.GetStyle());
+ SetWeight((wxFontWeight)font.GetWeight());
+ SetUnderlined(font.GetUnderlined());
+#if defined(__WXMSW__)
+ if ( font.IsUsingSizeInPixels() )
+ SetPixelSize(font.GetPixelSize());
+ else
+ SetPointSize(font.GetPointSize());
+#else
+ SetPointSize(font.GetPointSize());
+#endif
+
+ // set the family/facename
+ SetFamily((wxFontFamily)font.GetFamily());
+ const wxString& facename = font.GetFaceName();
+ if ( !facename.empty() )
+ {
+ SetFaceName(facename);
+ }
+
+ // deal with encoding now (it may override the font family and facename
+ // so do it after setting them)
+ SetEncoding(font.GetEncoding());
+ }
+
+ // accessors and modifiers for the font elements
+ int GetPointSize() const;
+ wxSize GetPixelSize() const;
+ wxFontStyle GetStyle() const;
+ wxFontWeight GetWeight() const;
+ bool GetUnderlined() const;
+ wxString GetFaceName() const;
+ wxFontFamily GetFamily() const;
+ wxFontEncoding GetEncoding() const;
+
+ void SetPointSize(int pointsize);
+ void SetPixelSize(const wxSize& pixelSize);
+ void SetStyle(wxFontStyle style);
+ void SetWeight(wxFontWeight weight);
+ void SetUnderlined(bool underlined);
+ bool SetFaceName(const wxString& facename);
+ void SetFamily(wxFontFamily family);
+ void SetEncoding(wxFontEncoding encoding);
+
+ // sets the first facename in the given array which is found
+ // to be valid. If no valid facename is given, sets the
+ // first valid facename returned by wxFontEnumerator::GetFacenames().
+ // Does not return a bool since it cannot fail.
+ void SetFaceName(const wxArrayString &facenames);
+
+