]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
Applied patch [ 1349607 ] [msw] Multiline notebook tab label change can add extra row
[wxWidgets.git] / src / msw / font.cpp
index 6c47dc906f0da735ce11824d0b1a91541b93f46a..d335ae6fce6bd48a49302192a12059344ca32b55 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "font.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -108,7 +104,7 @@ public:
     // constructors
     wxFontRefData()
     {
     // constructors
     wxFontRefData()
     {
-        Init(-1, wxSize(), false, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
+        Init(-1, wxSize(0,0), false, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
              wxFONTWEIGHT_NORMAL, false, wxEmptyString,
              wxFONTENCODING_DEFAULT);
     }
              wxFONTWEIGHT_NORMAL, false, wxEmptyString,
              wxFONTENCODING_DEFAULT);
     }
@@ -566,7 +562,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined)
     lf.lfUnderline = underlined;
 }
 
     lf.lfUnderline = underlined;
 }
 
-void wxNativeFontInfo::SetFaceName(wxString facename)
+void wxNativeFontInfo::SetFaceName(const wxString& facename)
 {
     wxStrncpy(lf.lfFaceName, facename, WXSIZEOF(lf.lfFaceName));
 }
 {
     wxStrncpy(lf.lfFaceName, facename, WXSIZEOF(lf.lfFaceName));
 }
@@ -606,8 +602,16 @@ void wxNativeFontInfo::SetFamily(wxFontFamily family)
 
         case wxDEFAULT:
         default:
 
         case wxDEFAULT:
         default:
+        {
+            // We want Windows 2000 or later to have new fonts even MS Shell Dlg
+            // is returned as default GUI font for compatibility
+            int verMaj;
             ff_family = FF_SWISS;
             ff_family = FF_SWISS;
-            facename = _T("MS Sans Serif");
+            if(wxGetOsVersion(&verMaj) == wxWINDOWS_NT && verMaj >= 5)
+                facename = _T("MS Shell Dlg 2");
+            else
+                facename = _T("MS Shell Dlg");
+        }
     }
 
     lf.lfPitchAndFamily = (BYTE)(DEFAULT_PITCH) | ff_family;
     }
 
     lf.lfPitchAndFamily = (BYTE)(DEFAULT_PITCH) | ff_family;