Index: trunk/src/lib/graphics/text_engine/font.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/font.cc	(revision 8764)
+++ trunk/src/lib/graphics/text_engine/font.cc	(revision 8765)
@@ -192,5 +192,6 @@
 void Font::setStyle(const std::string& renderStyle)
 {
-  this->data->setStyle(renderStyle);
+  /// FIXME
+  //this->data->setStyle(renderStyle);
 }
 
@@ -207,9 +208,11 @@
  * @param fileName the File to write the image into.
  */
-void Font::createAsciiImage(const std::string& fileName, unsigned int size) const
-{
-  if (this->data->fontTTF == NULL)
+void Font::createAsciiImage(const std::string& ttfFile, const std::string& fileName, unsigned int size)
+{
+  TTF_Font* fontTTF = TTF_OpenFont(ttfFile.c_str(), size);
+
+  if (fontTTF == NULL)
     return;
-  int height = this->getMaxHeight();
+  int height = TTF_FontHeight(fontTTF);
 
   //
@@ -241,9 +244,7 @@
     {
       SDL_Surface* glyphSurf = NULL;
-      if (likely(this->data->fontTTF != NULL))
-      {
-        SDL_Color white = {255, 255, 255};
-        glyphSurf = TTF_RenderGlyph_Blended(this->data->fontTTF, posX+size*posY, white);
-      }
+      SDL_Color white = {255, 255, 255};
+      glyphSurf = TTF_RenderGlyph_Blended(fontTTF, posX+size*posY, white);
+
       if( glyphSurf != NULL )
       {
@@ -259,4 +260,6 @@
   SDL_SaveBMP(tmpSurf, fileName.c_str());
   SDL_FreeSurface(tmpSurf);
+
+  TTF_CloseFont(fontTTF);
 }
 
@@ -273,5 +276,5 @@
   PRINT(0)("TEST %p and %p\n", this->data.get(), this->data->texData.get());
   // print the loaded font's style
-  int style = TTF_STYLE_NORMAL;
+/*  int style = TTF_STYLE_NORMAL;
   if (likely(this->data->fontTTF != NULL))
     style = TTF_GetFontStyle(this->data->fontTTF);
@@ -286,6 +289,6 @@
       PRINTF(0)(" italic");
     if(style&TTF_STYLE_UNDERLINE)
-      PRINTF(0)(" underline");
-  }
+      PRINTF(0)(" underline");*/
+//  }
   PRINTF(0)("\n");
 }
Index: trunk/src/lib/graphics/text_engine/font.h
===================================================================
--- trunk/src/lib/graphics/text_engine/font.h	(revision 8764)
+++ trunk/src/lib/graphics/text_engine/font.h	(revision 8765)
@@ -40,6 +40,4 @@
   /** @returns a Pointer to the Array of Glyphs */
   inline Glyph** getGlyphArray() const { return this->data->getGlyphArray(); };
-  /** @returns the a pointer to the TTF */
-  inline TTF_Font* getTTF() const { return this->data->getTTF(); };
 
   inline int getMaxHeight() const { return data->getMaxHeight(); };
@@ -48,5 +46,5 @@
 
 
-  void createAsciiImage(const std::string& fileName, unsigned int size) const;
+  static void createAsciiImage(const std::string& ttfFile, const std::string& fileName, unsigned int size);
 
   void debug() const;
Index: trunk/src/lib/graphics/text_engine/font_data.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/font_data.cc	(revision 8764)
+++ trunk/src/lib/graphics/text_engine/font_data.cc	(revision 8765)
@@ -28,11 +28,13 @@
  */
 FontData::FontData()
-  : texData(new TextureData)
-{
-  printf("CREATE FONT_DATA\n");
-  this->fontTTF = NULL;
+    : texData(new TextureData)
+{
   this->glyphArray = NULL;
   this->renderStyle = TTF_STYLE_NORMAL;
   this->renderSize = FONT_DEFAULT_RENDER_SIZE;
+
+  this->maxHeight = 0;
+  this->maxAscent = 0;
+  this->maxDescent = 0;
 }
 
@@ -60,47 +62,5 @@
   //     if(glIsTexture(this->fastTextureID))
   //       glDeleteTextures(1, &this->fastTextureID);
-
-  // erease this font out of the memory.
-  if (likely(this->fontTTF != NULL))
-    TTF_CloseFont(this->fontTTF);
-}
-
-/**
- * @returns the maximum height of the Font, if the font was initialized, 0 otherwise
- */
-int FontData::getMaxHeight() const
-{
-  if (likely (this->fontTTF != NULL))
-    return TTF_FontHeight(this->fontTTF);
-  else
-    return 1;
-}
-
-/**
- * @returns the maximum ascent of the Font, if the font was initialized, 0 otherwise
- *
- * the ascent is the pixels of the font above the baseline
- */
-int FontData::getMaxAscent() const
-{
-  if (likely(this->fontTTF != NULL))
-    return TTF_FontAscent(this->fontTTF);
-  else
-    return 0;
-}
-
-/**
- * @returns the maximum descent of the Font, if the font was initialized, 0 otherwise
- *
- * the descent is the pixels of the font below the baseline
- */
-int FontData::getMaxDescent() const
-{
-  if (likely(this->fontTTF != NULL))
-    return TTF_FontDescent(this->fontTTF);
-  else
-    return 0;
-}
-
+}
 
 
@@ -112,15 +72,26 @@
 bool FontData::loadFontFromTTF(const std::string& fontFile, unsigned int renderSize)
 {
+  TTF_Font* fontTTF;
   //this->setName(fontFile);
-  this->fontTTF = TTF_OpenFont(fontFile.c_str(), renderSize);
+  fontTTF = TTF_OpenFont(fontFile.c_str(), renderSize);
   this->renderSize = renderSize;
 
-  if(this->fontTTF != NULL)
-  {
-    this->setStyle("c");
-    if (this->createFastTexture())
+  if(fontTTF != NULL)
+  {
+    this->maxHeight = TTF_FontHeight(fontTTF);
+    this->maxAscent = TTF_FontAscent(fontTTF);
+    this->maxDescent = TTF_FontDescent(fontTTF);
+
+    this->setStyle(fontTTF, "c");
+    if (this->createFastTexture(fontTTF))
+    {
+      TTF_CloseFont(fontTTF);
       return true;
+    }
+
     else
     {
+      TTF_CloseFont(fontTTF);
+      PRINTF(1)("Unable to createa a Fast Texture fot %s\n", fontFile.c_str() );
       return false;
     }
@@ -128,5 +99,5 @@
   else
   {
-    PRINTF(1)("TTF_OpenFont: %s\n", TTF_GetError());
+    PRINTF(1)("TTF_OpenFont: %s for %s\n", TTF_GetError(), fontFile.c_str());
     return false;
   }
@@ -194,5 +165,5 @@
  *   i: italic, b: bold, u, underline
  */
-void FontData::setStyle(const std::string& renderStyle)
+void FontData::setStyle(TTF_Font* font, const std::string& renderStyle)
 {
   this->renderStyle = TTF_STYLE_NORMAL;
@@ -207,6 +178,9 @@
       this->renderStyle |= TTF_STYLE_UNDERLINE;
   }
-  if (likely(this->fontTTF != NULL))
-    TTF_SetFontStyle(this->fontTTF, this->renderStyle);
+
+  /// !TODO REBUILD THE FONT
+
+  if (likely(font != NULL))
+      TTF_SetFontStyle(font, this->renderStyle);
   //  else
   //    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
@@ -225,14 +199,14 @@
  * for more info about vertical Fonts
  */
-bool FontData::getGlyphMetrics(Glyph* glyph, Uint16 character)
+bool FontData::getGlyphMetrics(TTF_Font* font, Glyph* glyph, Uint16 character)
 {
   glyph->character = character;
-  if (likely (this->fontTTF!= NULL))
+  if (likely (font != NULL))
   {
     int miX, maX, miY, maY, adv;
-    if (TTF_GlyphMetrics(this->fontTTF, glyph->character,
-        &miX, &maX,
-        &miY, &maY,
-        &adv) == -1)
+    if (TTF_GlyphMetrics(font, glyph->character,
+                         &miX, &maX,
+                         &miY, &maY,
+                         &adv) == -1)
       return false;
     glyph->minX = (float)miX / (float)this->renderSize;
@@ -259,5 +233,5 @@
  * @brief creates a Fast-Texture of this Font
  */
-bool FontData::createFastTexture()
+bool FontData::createFastTexture(TTF_Font* fontTTF)
 {
   /* interesting GLYPHS:
@@ -271,5 +245,5 @@
   int numberOfGlyphs = 91;
 
-  this->initGlyphs(32, numberOfGlyphs);
+  this->initGlyphs(fontTTF, 32, numberOfGlyphs);
   //  this->glyphArray[32]->width = .5f; //!< @todo find out the real size of a Space
 
@@ -281,6 +255,6 @@
   SDL_Rect tmpRect; // this represents a Rectangle for blitting.
   SDL_Surface* tmpSurf =  SDL_CreateRGBSurface(SDL_HWSURFACE,
-                                               rectSize, rectSize,
-                                               32,
+                          rectSize, rectSize,
+                          32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
                           0x000000FF,
@@ -289,5 +263,5 @@
                           0xFF000000
 #else
-                              0xFF000000,
+                          0xFF000000,
                           0x00FF0000,
                           0x0000FF00,
@@ -321,8 +295,8 @@
       }
       // reading in the new Glyph
-      if (likely(this->fontTTF != NULL))
+      if (likely(fontTTF != NULL))
       {
         SDL_Color white = {255, 255, 255};
-        glyphSurf = TTF_RenderGlyph_Blended(this->fontTTF, i, white);
+        glyphSurf = TTF_RenderGlyph_Blended(fontTTF, i, white);
       }
       if( glyphSurf != NULL )
@@ -344,7 +318,7 @@
   }
   // outputting the GLYPH-table
-//       char outName[1024];
-//       sprintf( outName, "%s-glyphs.bmp", this->getName());
-//       SDL_SaveBMP(tmpSurf, outName);
+  //       char outName[1024];
+  //       sprintf( outName, "%s-glyphs.bmp", this->getName());
+  //       SDL_SaveBMP(tmpSurf, outName);
   this->texData->setAlpha(true);
   if (this->texData->setSurface(tmpSurf))
@@ -358,5 +332,5 @@
  * @param count The number of Glyphs to start From.
  */
-void FontData::initGlyphs(Uint16 from, Uint16 count)
+void FontData::initGlyphs(TTF_Font* font, Uint16 from, Uint16 count)
 {
   /* initialize the Array, and set all its entries to NULL
@@ -376,5 +350,5 @@
     // setting up all the Glyphs we like.
     Glyph* newGlyph = new Glyph;
-    if (getGlyphMetrics(newGlyph, i))
+    if (getGlyphMetrics(font, newGlyph, i))
       this->glyphArray[i] = newGlyph;
     else
Index: trunk/src/lib/graphics/text_engine/font_data.h
===================================================================
--- trunk/src/lib/graphics/text_engine/font_data.h	(revision 8764)
+++ trunk/src/lib/graphics/text_engine/font_data.h	(revision 8765)
@@ -59,5 +59,5 @@
   bool loadFontFromSDL_Surface(SDL_Surface* surface);
 
-  void setStyle(const std::string& renderStyle);
+  void setStyle(TTF_Font* font, const std::string& renderStyle);
 
 
@@ -65,10 +65,8 @@
   /** @returns a Pointer to the Array of Glyphs */
   inline Glyph** getGlyphArray() const { return this->glyphArray; };
-  /** @returns the a pointer to the TTF */
-  inline TTF_Font* getTTF() const { return this->fontTTF; };
 
-  int getMaxHeight() const;
-  int getMaxAscent() const;
-  int getMaxDescent() const;
+  int getMaxHeight() const { return maxHeight; };
+  int getMaxAscent() const { return maxAscent; };
+  int getMaxDescent() const { return maxDescent; };
 
 
@@ -82,16 +80,21 @@
   FontData();
 
-  void initGlyphs(Uint16 from, Uint16 count);
-  bool getGlyphMetrics(Glyph* glyph, Uint16 character);
+  void initGlyphs(TTF_Font* font, Uint16 from, Uint16 count);
+  bool getGlyphMetrics(TTF_Font* font, Glyph* glyph, Uint16 character);
 
   int findOptimalFastTextureSize();
-  bool createFastTexture();
+  bool createFastTexture(TTF_Font* font);
 
 private:
-  TTF_Font*     fontTTF;             //!< The font we use for this.
+  std::string   fontFile;            //!< The FileName the Font was loaded from.
+
   int           renderStyle;         //!< The Renderstyle
   unsigned int  renderSize;          //!< How big the Font should be rendered.
 
   Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
+
+  int           maxHeight;           //!< Max Height of the Font.
+  int           maxAscent;           //!< Max Ascent of the Font.
+  int           maxDescent;          //!< Max Desent of the Font.
 
   TextureDataPointer   texData;
