]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/font.cpp
Fixed a '&' that should be an '&&'
[wxWidgets.git] / src / gtk / font.cpp
index 15909254a4a109c07bd90fcf085286ae773d4e2e..940b38d81aa1be78f189ecfb2416092228e5c48b 100644 (file)
@@ -186,7 +186,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
 {
     if( !fontname )
     {
-         *this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);
+         *this = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT);
          return TRUE;
     }
 
@@ -307,6 +307,11 @@ wxFont::~wxFont()
 // accessors
 // ----------------------------------------------------------------------------
 
+bool wxFont::HasNativeFont() const
+{
+    return !M_FONTDATA->m_nativeFontInfo.xFontName.empty();
+}
+
 int wxFont::GetPointSize() const
 {
     wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
@@ -367,6 +372,21 @@ wxNativeFontInfo *wxFont::GetNativeFontInfo() const
     return new wxNativeFontInfo(M_FONTDATA->m_nativeFontInfo);
 }
 
+bool wxFont::IsFixedWidth() const
+{
+    wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+
+    if ( HasNativeFont() )
+    {
+        // the monospace fonts are supposed to have "M" in the spacing field
+        wxString spacing = M_FONTDATA->
+                            m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING);
+
+        return spacing.Upper() == _T('M');
+    }
+
+    return wxFontBase::IsFixedWidth();
+}
 
 // ----------------------------------------------------------------------------
 // change font attributes
@@ -487,7 +507,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const
     }
     else
     {
-        if (*this == wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT))
+        if (*this == wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT))
         {
             font = GtkGetDefaultGuiFont();
         }