Index: /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc
===================================================================
--- /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc	(revision 3695)
+++ /orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc	(revision 3696)
@@ -53,9 +53,16 @@
 #include "debug.h"
 
-GLFont::GLFont(const char* fontFile, unsigned int fontSize)
-{
-  this->init(fontFile, fontSize);
-}
-
+/**
+   \brief constructs a Font
+   \param fontFile the File to load the font from
+*/
+GLFont::GLFont(const char* fontFile)
+{
+  this->init(fontFile);
+}
+
+/**
+   \brief destructs a font
+*/
 GLFont::~GLFont(void)
 {
@@ -65,5 +72,5 @@
 
 /**
-   \function to enable TTF_Fonts
+   \brief function to enable TTF_Fonts
 */
 void GLFont::enableFonts(void)
@@ -113,5 +120,6 @@
   this->font = NULL;
   this->fontFile = NULL;
-
+  this->text = NULL;
+  this->texture = 0;
   
   this->setSize(fontSize);
@@ -121,6 +129,7 @@
   this->setFont(fontFile);
 
-  this->setText( FONT_DEFAULT_TEXT);
-
+  this->setText(FONT_DEFAULT_TEXT);
+
+  this->createTexture();
 }
 
@@ -158,8 +167,8 @@
 void GLFont::setText(const char* text)
 {
+  if (this->text)
+    delete []this->text;
   this->text = new char[strlen(text)+1];
   strcpy(this->text, text);
-
-  this->createTexture();
 }
 
@@ -216,6 +225,6 @@
 void GLFont::setPosition(int x, int y)
 {
-  this->positionX = x;
-  this->positionY = y;
+  this->textPosSize.x = x;
+  this->textPosSize.y = y;
 }
 
@@ -246,5 +255,8 @@
 {
   GLfloat texcoord[4];
-  SDL_Surface* tmpSurf = TTF_RenderText_Blended(this->font, this->text, this->color);
+  SDL_Surface* tmpSurf;
+  if (this->texture)
+    glDeleteTextures(1, &this->texture);
+  tmpSurf = TTF_RenderText_Blended(this->font, this->text, this->color);
   if (tmpSurf)
     this->texture = loadTexture(tmpSurf, texcoord);
@@ -446,5 +458,24 @@
 }
 
-
+/**
+   \brief Quick utility function for texture creation 
+   \param input an integer
+   \returns the next bigger 2^n-integer than input
+*/
+int GLFont::powerOfTwo(int input)
+{
+  int value = 1;
+  
+  while ( value < input ) {
+    value <<= 1;
+  }
+  return value;
+}
+
+
+/**
+   \brief checks if the compiled version and the local version of SDL_ttf match.
+   \returns true if match, false otherwise
+*/
 bool GLFont::checkVersion(void)
 {
@@ -475,20 +506,4 @@
 }
 
-
-
-/**
-   \brief Quick utility function for texture creation 
-   \param input an integer
-   \returns the next bigger 2^n-integer than input
-*/
-int GLFont::powerOfTwo(int input)
-{
-  int value = 1;
-  
-  while ( value < input ) {
-    value <<= 1;
-  }
-  return value;
-}
 
 
Index: /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h
===================================================================
--- /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h	(revision 3695)
+++ /orxonox/branches/textEngine/src/lib/graphics/font/glfont.h	(revision 3696)
@@ -43,5 +43,5 @@
 {
  public:
-  GLFont(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE);
+  GLFont(const char* fontFile);
   virtual ~GLFont();
 
@@ -59,27 +59,19 @@
   void createTexture(void);
   
-  void renderText(void);
-  void renderText(const char* text, int x, int y);
-
   virtual void draw(void);
 
  private:
   // information about the Font
-  TTF_Font* font;
-  char* fontFile;
-  char* text;
-  unsigned int fontSize;
-  SDL_Color color;
+  TTF_Font* font;                  //!< The font we use for this.
+  char* fontFile;                  //!< The fontfile from whitch the font was loaded.
+  char* text;                      //!< The text to display
+  unsigned int fontSize;           //!< The size of the font in pixels
+  SDL_Color color;                 //!< The color of the font.
 
   // placement in openGL
-  GLuint texture;
-  SDL_Rect textPosSize;               //!< A SDL-Rectangle representing the position and size of the Text on the screen.
-  int positionX;
-  int positionY;
-  int width;
-  int height;
-  int renderStyle;
-  SDL_Surface* surface;
-  GLfloat* texcoord;
+  GLuint texture;                  //!< A GL-texture to hold the text
+  SDL_Rect textPosSize;            //!< An SDL-Rectangle representing the position and size of the Text on the screen.
+  int renderStyle;                 //!< The Renderstyle
+  GLfloat* texcoord;               //!< Texture-coordinates \todo fix this to have a struct
 
   bool init(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE);
Index: /orxonox/branches/textEngine/src/story_entities/world.cc
===================================================================
--- /orxonox/branches/textEngine/src/story_entities/world.cc	(revision 3695)
+++ /orxonox/branches/textEngine/src/story_entities/world.cc	(revision 3696)
@@ -203,5 +203,5 @@
       testFont = new FontSet();
       testFont->buildFont("../data/pictures/font.tga");
-      tmpFont = new GLFont("../data/fonts/refluxed.ttf", 50);
+      tmpFont = new GLFont("../data/fonts/refluxed.ttf");
       this->glmis->step();
 
