+ // 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());
+ }
+