Index: /trunk/src/lib/graphics/text_engine/font.cc
===================================================================
--- /trunk/src/lib/graphics/text_engine/font.cc	(revision 5367)
+++ /trunk/src/lib/graphics/text_engine/font.cc	(revision 5368)
@@ -36,13 +36,13 @@
  * @param fontSize the Size of the Font in Pixels
  */
-Font::Font(const char* fontFile, unsigned int fontSize)
+Font::Font(const char* fontFile, unsigned int renderSize)
 {
   this->init();
 
-  this->setSize(fontSize);
+  this->renderSize = renderSize;
   this->setStyle("c");
 
   if (fontFile != NULL)
-    this->loadFont(fontFile);
+    this->loadFontFromTTF(fontFile);
 }
 
@@ -118,6 +118,6 @@
 
   // erease this font out of the memory.
-  if (likely(this->font != NULL))
-    TTF_CloseFont(this->font);
+  if (likely(this->fontTTF != NULL))
+    TTF_CloseFont(this->fontTTF);
 }
 
@@ -129,5 +129,5 @@
   this->setClassID(CL_FONT, "Font");
   // setting default values.
-  this->font = NULL;
+  this->fontTTF = NULL;
   this->glyphArray = NULL;
   this->fastTextureID = 0;
@@ -140,11 +140,11 @@
  * @returns true if loaded, false if something went wrong, or if a font was loaded before.
  */
-bool Font::loadFont(const char* fontFile)
+bool Font::loadFontFromTTF(const char* fontFile)
 {
   // checking for existent Font.
-  if (this->font != NULL)
-  {
-    TTF_CloseFont(this->font);
-    this->font = NULL;
+  if (this->fontTTF != NULL)
+  {
+    TTF_CloseFont(this->fontTTF);
+    this->fontTTF = NULL;
   }
   if (this->fastTextureID != 0)
@@ -156,7 +156,7 @@
 
   this->setName(fontFile);
-  this->font = TTF_OpenFont(this->getName(), this->fontSize);
-
-  if(this->font != NULL)
+  this->fontTTF = TTF_OpenFont(this->getName(), this->renderSize);
+
+  if(this->fontTTF != NULL)
   {
     this->fastTextureID = this->createFastTexture();
@@ -184,8 +184,8 @@
     return false;
 
-  if (this->font != NULL)
-  {
-    TTF_CloseFont(this->font);
-    this->font = NULL;
+  if (this->fontTTF != NULL)
+  {
+    TTF_CloseFont(this->fontTTF);
+    this->fontTTF = NULL;
   }
   if (this->fastTextureID != 0)
@@ -214,8 +214,8 @@
       tmpGlyph->texCoord[2] = cy+0.001f;
       tmpGlyph->texCoord[3] = cy+0.0625f;
-      tmpGlyph->width = 16;
-      tmpGlyph->bearingX = 16;
-      tmpGlyph->bearingY = 16;
-      tmpGlyph->height = 16;
+      tmpGlyph->width = 1;
+      tmpGlyph->bearingX = 1;
+      tmpGlyph->bearingY = 1;
+      tmpGlyph->height = 1;
     }
   }
@@ -241,24 +241,15 @@
     this->renderStyle |= TTF_STYLE_UNDERLINE;
 
-  if (likely(this->font != NULL))
-    TTF_SetFontStyle(this->font, this->renderStyle);
+  if (likely(this->fontTTF != NULL))
+    TTF_SetFontStyle(this->fontTTF, this->renderStyle);
 //  else
 //    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
 }
 
-/**
- *  Sets a new Size to the font
- * @param fontSize The new Size in pixels.
- */
-void Font::setSize(unsigned int fontSize)
-{
-  this->fontSize = fontSize;
-}
-
 Font* Font::defaultFont = NULL;
 
 void Font::createAsciiImage(const char* fileName)
 {
-  if (this->font == NULL)
+  if (this->fontTTF == NULL)
     return;
   int height = this->getMaxHeight();
@@ -294,8 +285,8 @@
     {
       SDL_Surface* glyphSurf = NULL;
-      if (likely(this->font != NULL))
+      if (likely(this->fontTTF != NULL))
       {
         SDL_Color white = {255, 255, 255};
-        glyphSurf = TTF_RenderGlyph_Blended(this->font, posX+16*posY, white);
+        glyphSurf = TTF_RenderGlyph_Blended(this->fontTTF, posX+16*posY, white);
       }
       if( glyphSurf != NULL )
@@ -339,6 +330,6 @@
 int Font::getMaxHeight()
 {
-  if (likely (this->font != NULL))
-    return TTF_FontHeight(this->font);
+  if (likely (this->fontTTF != NULL))
+    return TTF_FontHeight(this->fontTTF);
   else
     return 0;
@@ -352,6 +343,6 @@
 int Font::getMaxAscent()
 {
-  if (likely(this->font != NULL))
-    return TTF_FontAscent(this->font);
+  if (likely(this->fontTTF != NULL))
+    return TTF_FontAscent(this->fontTTF);
   else
     return 0;
@@ -365,6 +356,6 @@
 int Font::getMaxDescent()
 {
-  if (likely(this->font != NULL))
-    return TTF_FontDescent(this->font);
+  if (likely(this->fontTTF != NULL))
+    return TTF_FontDescent(this->fontTTF);
   else
     return 0;
@@ -384,9 +375,17 @@
   Glyph* rg = new Glyph;
   rg->character = character;
-  if (likely (this->font!= NULL))
-    TTF_GlyphMetrics(this->font, rg->character,
-                     &rg->minX, &rg->maxX,
-                     &rg->minY, &rg->maxY,
-                     &rg->advance);
+  if (likely (this->fontTTF!= NULL))
+  {
+    int miX, maX, miY, maY, adv;
+    TTF_GlyphMetrics(this->fontTTF, rg->character,
+                     &miX, &maX,
+                     &miY, &maY,
+                     &adv);
+    rg->minX = (float)miX / (float)this->renderSize;
+    rg->maxX = (float)maX / (float)this->renderSize;
+    rg->minY = (float)miY / (float)this->renderSize;
+    rg->maxY = (float)maY / (float)this->renderSize;
+    rg->advance = (float)adv / (float)this->renderSize;
+  }
   rg->height = rg->maxY - rg->minY;
   rg->width = rg->maxX - rg->minX;
@@ -412,5 +411,5 @@
 
   this->initGlyphs(32, numberOfGlyphs);
-  this->glyphArray[32]->width = fontSize/2; //!< @todo find out the real size of a Space
+  this->glyphArray[32]->width = .5f; //!< @todo find out the real size of a Space
 
   int rectSize = this->findOptimalFastTextureSize();
@@ -447,8 +446,8 @@
     if (tmpGlyph = this->glyphArray[i])
     {
-      if (tmpGlyph->height > maxLineHeight)
-        maxLineHeight = tmpGlyph->height;
-
-      if (tmpRect.x+tmpGlyph->advance > tmpSurf->w)
+      if (tmpGlyph->height*this->renderSize > maxLineHeight)
+        maxLineHeight = (int)(tmpGlyph->height*this->renderSize);
+
+      if (tmpRect.x+tmpGlyph->advance*this->renderSize > tmpSurf->w)
       {
         tmpRect.x = 0;
@@ -462,8 +461,8 @@
       }
           // reading in the new Glyph
-      if (likely(this->font != NULL))
+      if (likely(this->fontTTF != NULL))
       {
         SDL_Color white = {255, 255, 255};
-        glyphSurf = TTF_RenderGlyph_Blended(this->font, i, white);
+        glyphSurf = TTF_RenderGlyph_Blended(this->fontTTF, i, white);
       }
       if( glyphSurf != NULL )
@@ -473,13 +472,13 @@
         SDL_BlitSurface(glyphSurf, NULL, tmpSurf, &tmpRect);
         tmpGlyph->texCoord[0] = (float)tmpRect.x/(float)tmpSurf->w;
-        tmpGlyph->texCoord[1] = (float)(tmpRect.x + tmpGlyph->advance)/(float)tmpSurf->w;
+        tmpGlyph->texCoord[1] = (float)(tmpRect.x + tmpGlyph->advance*this->renderSize)/(float)tmpSurf->w;
         tmpGlyph->texCoord[2] = (float)(tmpRect.y)/(float)tmpSurf->w;
-        tmpGlyph->texCoord[3] = (float)(tmpRect.y+tmpGlyph->height)/(float)tmpSurf->w;
+        tmpGlyph->texCoord[3] = (float)(tmpRect.y+tmpGlyph->height*this->renderSize)/(float)tmpSurf->w;
         SDL_FreeSurface(glyphSurf);
 
-        tmpRect.x += tmpGlyph->advance;
+        tmpRect.x += (int)(tmpGlyph->advance*this->renderSize);
 
               // Outputting Glyphs to BMP-files.
-/*
+        /*
         char outname[512];
         if (i < 10)
@@ -489,6 +488,6 @@
         else
         sprintf( outname, "%s-glyph-%d.bmp", this->getName(), i );
-        SDL_SaveBMP(tmpSurf, outname);*/
-
+        SDL_SaveBMP(tmpSurf, outname);
+        */
       }
     }
@@ -568,8 +567,8 @@
       {
               // getting the height of the highest Glyph in the Line.
-        if (tmpGlyph->height > maxLineHeight)
-          maxLineHeight = tmpGlyph->height;
-
-        if (x + tmpGlyph->advance > size)
+        if (tmpGlyph->height*this->renderSize > maxLineHeight)
+          maxLineHeight = (int)(tmpGlyph->height*this->renderSize);
+
+        if (x + tmpGlyph->advance*this->renderSize > size)
         {
           x = 0;
@@ -579,5 +578,5 @@
         if (y + maxLineHeight + 1 > size)
           break;
-        x += tmpGlyph->advance;
+        x += (int)(tmpGlyph->advance*this->renderSize);
 
       }
@@ -599,6 +598,6 @@
   // print the loaded font's style
   int style;
-  if (likely(this->font != NULL))
-    style = TTF_GetFontStyle(this->font);
+  if (likely(this->fontTTF != NULL))
+    style = TTF_GetFontStyle(this->fontTTF);
   PRINTF(0)("The font style is:");
   if(style==TTF_STYLE_NORMAL)
Index: /trunk/src/lib/graphics/text_engine/font.h
===================================================================
--- /trunk/src/lib/graphics/text_engine/font.h	(revision 5367)
+++ /trunk/src/lib/graphics/text_engine/font.h	(revision 5368)
@@ -37,13 +37,13 @@
   // Glyph-specific (size and so on)
   Uint16   character;         //!< The character
-  int      minX;              //!< The minimum distance from the origin in X
-  int      maxX;              //!< The maximum distance from the origin in X
-  int      minY;              //!< The minimum distance from the origin in Y
-  int      maxY;              //!< The maximum distance from the origin in Y
-  int      width;             //!< The width of the Glyph
-  int      height;            //!< The height of the Glyph
-  int      bearingX;          //!< How much is right of the Origin
-  int      bearingY;          //!< How much is above the Origin
-  int      advance;           //!< How big a Glyph would be in monospace-mode
+  float    minX;              //!< The minimum distance from the origin in X
+  float    maxX;              //!< The maximum distance from the origin in X
+  float    minY;              //!< The minimum distance from the origin in Y
+  float    maxY;              //!< The maximum distance from the origin in Y
+  float    width;             //!< The width of the Glyph
+  float    height;            //!< The height of the Glyph
+  float    bearingX;          //!< How much is right of the Origin
+  float    bearingY;          //!< How much is above the Origin
+  float    advance;           //!< How big a Glyph would be in monospace-mode
 
   GLfloat texCoord[4];        //!< Texture coordinates: 0:left, 1:right, 2: top, 3: bottom.
@@ -58,5 +58,5 @@
   public:
     Font(const char* fontFile,
-         unsigned int fontSize);
+         unsigned int renderSize);
     Font(const char* imageFile);
     Font(char** xpmArray);
@@ -66,8 +66,7 @@
 
   // font
-    bool loadFont(const char* fontFile);
+    bool loadFontFromTTF(const char* fontFile);
     bool loadFontFromSDL_Surface(SDL_Surface* surface);
 
-    void setSize(unsigned int fontSize);
     void setStyle(const char* renderStyle);
 
@@ -82,4 +81,5 @@
     static void initDefaultFont();
     static void removeDefaultFont();
+
 
   private:
@@ -99,7 +99,7 @@
     static Font*  defaultFont;         //!< a default font, that is used, if other fonts were unable to be loaded.
     // information about the Font
-    TTF_Font*     font;                //!< The font we use for this.
-    unsigned int  fontSize;            //!< The size of the font in pixels. each Font has one size.
+    TTF_Font*     fontTTF;             //!< The font we use for this.
     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.
Index: /trunk/src/lib/graphics/text_engine/text.cc
===================================================================
--- /trunk/src/lib/graphics/text_engine/text.cc	(revision 5367)
+++ /trunk/src/lib/graphics/text_engine/text.cc	(revision 5368)
@@ -32,11 +32,12 @@
  * @param type The renderType to display this font in
  */
-Text::Text(const char* fontFile, unsigned int fontSize, TEXT_RENDER_TYPE type)
+Text::Text(const char* fontFile, unsigned int textSize, TEXT_RENDER_TYPE type)
 {
   this->init();
 
   if (fontFile != NULL)
-    this->setFont(fontFile, fontSize);
+    this->setFont(fontFile, textSize);
   this->setType(type);
+  this->size = textSize;
 }
 
@@ -109,5 +110,5 @@
 void Text::setType(TEXT_RENDER_TYPE type)
 {
-  if (this->font != NULL && this->font->font)
+  if (this->font != NULL && this->font->fontTTF)
     this->type = type;
   else
@@ -150,5 +151,5 @@
     Glyph** glyphArray = this->font->getGlyphArray();
 
-    int width = 0;
+    float width = 0;
     const char* tmpText = this->externText;
     if (this->externText == NULL)
@@ -184,5 +185,5 @@
   {
     SDL_Color theColor = { (int)(this->color.x*255), (int)(this->color.y*255), (int)(this->color.z*255) };
-    tmpSurf = TTF_RenderText_Blended(this->font->font,
+    tmpSurf = TTF_RenderText_Blended(this->font->fontTTF,
                                      this->text,
                                      theColor);
@@ -248,14 +249,14 @@
           glBegin(GL_QUADS);
           glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]);
-          glVertex2d(0, - tmpGlyph->bearingY);
+          glVertex2d(0, - tmpGlyph->bearingY * this->size);
           glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
-          glVertex2d(0, tmpGlyph->height - tmpGlyph->bearingY);
+          glVertex2d(0, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
           glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]);
-          glVertex2d(tmpGlyph->width, tmpGlyph->height - tmpGlyph->bearingY);
+          glVertex2d(tmpGlyph->width*this->size, (tmpGlyph->height - tmpGlyph->bearingY)*this->size);
           glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
-          glVertex2d(tmpGlyph->width, - tmpGlyph->bearingY);
+          glVertex2d(tmpGlyph->width*this->size, - tmpGlyph->bearingY*this->size);
           glEnd();
           glEndList();
-          glTranslatef(glyphArray[*tmpText]->width, 0, 0);
+          glTranslatef(glyphArray[*tmpText]->width*this->size, 0, 0);
         }
         tmpText++;
@@ -371,5 +372,5 @@
   glGenTextures(1, &texture);
   glBindTexture(GL_TEXTURE_2D, texture);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
   glTexImage2D(GL_TEXTURE_2D,
