Index: /branches/fontdata/src/lib/graphics/text_engine/font.cc
===================================================================
--- /branches/fontdata/src/lib/graphics/text_engine/font.cc	(revision 8752)
+++ /branches/fontdata/src/lib/graphics/text_engine/font.cc	(revision 8753)
@@ -27,7 +27,6 @@
 
 #include "debug.h"
-#include "stdlibincl.h"
 #include "compiler.h"
-using namespace std;
+
 
 /**
@@ -37,5 +36,5 @@
  */
 Font::Font(const std::string& fontFile, unsigned int renderSize)
-  : data(new FontData())
+  : data(Font::defaultFontData)
 {
   this->init();
@@ -54,7 +53,8 @@
  */
 Font::Font(const std::string& imageFile)
-  : data(new FontData())
+  : data(Font::defaultFontData)
 {
   this->init();
+
   this->setName(imageFile);
   //  this->setSize(fontSize);
@@ -78,5 +78,5 @@
  */
 Font::Font(char** xpmArray)
-  : data(new FontData())
+  : data(Font::defaultFontData)
 {
   this->init();
@@ -111,5 +111,9 @@
 {
   this->setClassID(CL_FONT, "Font");
-}
+  if (Font::defaultFontData.get() == NULL)
+    Font::defaultFontData = initDefaultFont();
+}
+
+FontDataPointer Font::defaultFontData = FontDataPointer(NULL); //initDefaultFont();
 
 
@@ -121,11 +125,5 @@
 bool Font::loadFontFromTTF(const std::string& fontFile)
 {
-  // checking for existent Font.
-  if (this->data->fontTTF != NULL)
-  {
-    TTF_CloseFont(this->data->fontTTF);
-    this->data->fontTTF = NULL;
-  }
-
+  this->data = FontDataPointer (new FontData());
 
   this->setName(fontFile);
@@ -223,6 +221,4 @@
   //    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
 }
-
-Font* Font::defaultFont = NULL;
 
 /**
@@ -288,20 +284,8 @@
  * @brief initializes the default font
  */
-void Font::initDefaultFont()
-{
-  if (Font::defaultFont == NULL)
-    Font::defaultFont = new Font(font_xpm);
-}
-
-/**
- * @brief deletes the default font
- */
-void Font::removeDefaultFont()
-{
-  if (Font::defaultFont != NULL)
-    delete Font::defaultFont;
-  Font::defaultFont = NULL;
-}
-
+FontDataPointer Font::initDefaultFont()
+{
+  return Font(font_xpm).data;
+}
 
 /**
@@ -569,5 +553,5 @@
  * @brief a simple function to get some interesting information about this class
  */
-void Font::debug()
+void Font::debug() const
 {
   // print the loaded font's style
Index: /branches/fontdata/src/lib/graphics/text_engine/font.h
===================================================================
--- /branches/fontdata/src/lib/graphics/text_engine/font.h	(revision 8752)
+++ /branches/fontdata/src/lib/graphics/text_engine/font.h	(revision 8753)
@@ -43,11 +43,11 @@
 
   /** @returns the default Font */
-  inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; };
+  //inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; };
+
+
 
   void createAsciiImage(const std::string& fileName, unsigned int size) const;
-  static void initDefaultFont();
-  static void removeDefaultFont();
 
-
+  void debug() const ;
 private:
   void init();
@@ -56,13 +56,15 @@
   bool createFastTexture();
 
+
   void initGlyphs(Uint16 from, Uint16 count);
   int findOptimalFastTextureSize();
 
-  void debug();
+
+  static FontDataPointer initDefaultFont();
 
 private:
-  static Font*  defaultFont;         //!< a default font, that is used, if other fonts were unable to be loaded.
+  static FontDataPointer    defaultFontData;     //!< a default font, that is used, if other fonts were unable to be loaded.
 
-  fontDataPointer data;
+  FontDataPointer           data;                //!< A Data-Pointer to a Font.
 };
 
Index: /branches/fontdata/src/lib/graphics/text_engine/font_data.h
===================================================================
--- /branches/fontdata/src/lib/graphics/text_engine/font_data.h	(revision 8752)
+++ /branches/fontdata/src/lib/graphics/text_engine/font_data.h	(revision 8753)
@@ -72,5 +72,5 @@
 };
 
-typedef CountPointer<FontData> fontDataPointer;
+typedef CountPointer<FontData> FontDataPointer;
 
 #endif /* _FONT_DATA_H */
Index: /branches/fontdata/src/lib/graphics/text_engine/text.cc
===================================================================
--- /branches/fontdata/src/lib/graphics/text_engine/text.cc	(revision 8752)
+++ /branches/fontdata/src/lib/graphics/text_engine/text.cc	(revision 8753)
@@ -56,6 +56,6 @@
 Text::~Text()
 {
-  if (this->_font != NULL && this->_font != Font::getDefaultFont())
-    ResourceManager::getInstance()->unload(this->_font);
+/*  if (this->_font != NULL && this->_font != Font::getDefaultFont())
+    ResourceManager::getInstance()->unload(this->_font);*/
 }
 
@@ -175,5 +175,5 @@
 {
   Font* newFont = NULL;
-  Font* oldFont = this->_font;
+//  Font* oldFont = this->_font;
 
   // load a new Font
@@ -183,16 +183,16 @@
     if (newFont == NULL)
     {
-      newFont = Font::getDefaultFont();
+      //      newFont = Font::getDefaultFont();
       PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile.c_str());
     }
   }
-  if (newFont == NULL)
-    newFont = Font::getDefaultFont();
+//  if (newFont == NULL)
+//    newFont = Font::getDefaultFont();
   assert(newFont != NULL);
 
   // unloading the Font if we alrady have one loaded.
   this->_font = newFont;
-  if (oldFont != NULL && oldFont != Font::getDefaultFont())
-    ResourceManager::getInstance()->unload(oldFont);
+//   if (oldFont != NULL && oldFont != Font::getDefaultFont())
+//     ResourceManager::getInstance()->unload(oldFont);
 
   this->setupTextWidth();
Index: /branches/fontdata/src/lib/graphics/text_engine/text_engine.cc
===================================================================
--- /branches/fontdata/src/lib/graphics/text_engine/text_engine.cc	(revision 8752)
+++ /branches/fontdata/src/lib/graphics/text_engine/text_engine.cc	(revision 8753)
@@ -76,6 +76,6 @@
     {
       Font* font = dynamic_cast<Font*>(fontList->back());
-      if (likely(font != Font::getDefaultFont()))
-        ResourceManager::getInstance()->unload(font, RP_GAME);
+      //if (likely(font != Font::getDefaultFont()))
+      //        ResourceManager::getInstance()->unload(font, RP_GAME);
     }
   }
@@ -108,5 +108,5 @@
   if (TTF_WasInit())
     {
-      Font::removeDefaultFont();
+//      Font::removeDefaultFont();
       TTF_Quit();
     }
