]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/fontutil.cpp
added at least some stderr support to wxMGL which suffers badly from MGL's hostile...
[wxWidgets.git] / src / mgl / fontutil.cpp
index a899e033f63936fbca0954fc67d27d7ab7fe9f23..7e262908627bede47d0eef736c7037f38c51ad6e 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Vaclav Slavik
 // Created:     2001/04/29
 // RCS-ID:      $Id$
-// Copyright:   (c) 2001, Vaclav Slavik
+// Copyright:   (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 #endif
 
 #ifndef WX_PRECOMP
+    #include "wx/log.h"
+    #include "wx/fontutil.h"
+    #include "wx/fontmap.h"
+    #include "wx/tokenzr.h"
+    #include "wx/hash.h"
 #endif // PCH
 
 
-#include "wx/fontutil.h"
-#include "wx/fontmap.h"
-#include "wx/tokenzr.h"
-#include "wx/hash.h"
-#include "wx/module.h"
 #include "wx/listimpl.cpp"
-#include "wx/log.h"
 #include "wx/mgl/private.h"
 
 #include <mgraph.h>
@@ -323,20 +322,17 @@ bool wxMGLFontFamily::HasFace(int type) const
 wxMGLFontLibrary *wxFontsManager::GetFontLibrary(wxFont *font)
 {
     wxMGLFontFamily *family;
-    wxString facename;
     int type;
+    wxString facename = font->GetFaceName();
     
-    if ( facename )
-        family = GetFamily(font->GetFaceName());
+    if ( !facename.IsEmpty() )
+        family = GetFamily(facename);
     else
         family = NULL;
-    if ( family )
-        facename = font->GetFaceName();
-    else
-        facename.Empty();
-    
+
     if ( !family )
     {
+        facename.Empty();
         switch (font->GetFamily())
         {
             case wxSCRIPT:
@@ -433,24 +429,3 @@ wxMGLFontFamily *wxFontsManager::GetFamily(const wxString& name) const
 
 
 wxFontsManager *wxTheFontsManager = NULL;
-
-
-// A module that takes care of fonts DB initialization and destruction:
-
-class wxFontutilModule: public wxModule
-{
-DECLARE_DYNAMIC_CLASS(wxFontutilModule)
-public:
-    wxFontutilModule() {}
-    bool OnInit() 
-    {
-        wxTheFontsManager = new wxFontsManager;
-        return TRUE; 
-    }
-    void OnExit() 
-    { 
-        delete wxTheFontsManager;
-    }
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxFontutilModule, wxModule)