]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
Added optional parameter to SelectDocumentType() and SelectViewType() to allow the...
[wxWidgets.git] / src / msw / font.cpp
index acb3be04c59d3d989da7a0dd06d77f76f8cbbfd1..4fcafbeb96f444da105ee5b84687b301e18cae81 100644 (file)
@@ -29,7 +29,6 @@
 #endif
 
 #ifndef WX_PRECOMP
-    #include <stdio.h>
     #include "wx/setup.h"
     #include "wx/list.h"
     #include "wx/utils.h"
@@ -38,6 +37,8 @@
     #include "wx/log.h"
 #endif // WX_PRECOMP
 
+#include "wx/fontutil.h"
+
 #include "wx/msw/private.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
@@ -166,6 +167,19 @@ void wxFont::Init()
         wxTheFontList->Append(this);
 }
 
+bool wxFont::Create(const wxNativeFontInfo& info)
+{
+    return Create(info.pointSize, info.family, info.style, info.weight,
+                  info.underlined, info.faceName, info.encoding);
+}
+
+wxFont::wxFont(const wxString& fontdesc)
+{
+    wxNativeFontInfo info;
+    if ( info.FromString(fontdesc) )
+        (void)Create(info);
+}
+
 /* Constructor for a font. Note that the real construction is done
  * in wxDC::SetFont, when information is available about scaling etc.
  */