]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
Rework the wxCusor ctor taking wx stock number to provide as many cursors as
[wxWidgets.git] / src / msw / font.cpp
index a457798069b59bb2ed13191f4e00ab7676b81914..eec88f8c060c4cd94b05e10dfe2759b4c80f1433 100644 (file)
 #include "wx/fontutil.h"
 #include "wx/fontmap.h"
 
 #include "wx/fontutil.h"
 #include "wx/fontmap.h"
 
+#ifndef __WXWINCE__
+    #include "wx/sysopt.h"
+#endif
+
 #include "wx/tokenzr.h"
 
 #if wxUSE_EXTENDED_RTTI
 #include "wx/tokenzr.h"
 
 #if wxUSE_EXTENDED_RTTI
@@ -318,7 +322,12 @@ public:
         { return m_nativeFontInfo; }
 
     void SetNativeFontInfo(const wxNativeFontInfo& nativeFontInfo)
         { return m_nativeFontInfo; }
 
     void SetNativeFontInfo(const wxNativeFontInfo& nativeFontInfo)
-        { Free(); m_nativeFontInfo = nativeFontInfo; }
+    {
+        Free();
+
+        m_nativeFontInfo = nativeFontInfo;
+        m_nativeFontInfoOk = true;
+    }
 
 protected:
     // common part of all ctors
 
 protected:
     // common part of all ctors
@@ -448,12 +457,16 @@ void wxNativeFontInfo::Init()
 {
     wxZeroMemory(lf);
 
 {
     wxZeroMemory(lf);
 
-    // we get better font quality if we use this instead of DEFAULT_QUALITY
-    // apparently without any drawbacks
+    // we get better font quality if we use PROOF_QUALITY instead of
+    // DEFAULT_QUALITY but some fonts (e.g. "Terminal 6pt") are not available
+    // then so we allow to set a global option to choose between quality and
+    // wider font selection
 #ifdef __WXWINCE__
     lf.lfQuality = CLEARTYPE_QUALITY;
 #else
 #ifdef __WXWINCE__
     lf.lfQuality = CLEARTYPE_QUALITY;
 #else
-    lf.lfQuality = PROOF_QUALITY;
+    lf.lfQuality = wxSystemOptions::GetOptionInt(_T("msw.font.no-proof-quality"))
+                    ? DEFAULT_QUALITY
+                    : PROOF_QUALITY;
 #endif
 }
 
 #endif
 }
 
@@ -463,7 +476,8 @@ int wxNativeFontInfo::GetPointSize() const
     //        for printing!
     const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
 
     //        for printing!
     const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
 
-    return (int) (((72.0*(double)abs(lf.lfHeight)) / (double) ppInch) + 0.5);
+    // BC++ 2007 doesn't provide abs(long) overload, hence the cast
+    return (int) (((72.0*abs((int)lf.lfHeight)) / (double) ppInch) + 0.5);
 }
 
 wxSize wxNativeFontInfo::GetPixelSize() const
 }
 
 wxSize wxNativeFontInfo::GetPixelSize() const