Index: trunk/src/lib/graphics/text_engine/font.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/font.cc	(revision 7429)
+++ trunk/src/lib/graphics/text_engine/font.cc	(revision 7430)
@@ -361,35 +361,39 @@
 
 /**
- * @param character The character to get info about.
+ * @param glyph: The Glyph to set the Parameters to.
+ * @param character: The character to get info about.
  * @returns a Glyph struct of a character. This Glyph is a pointer,
-   and MUST be deleted by the user..
-
-   This only works for horizontal fonts. see
-   http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html
-   for more info about vertical Fonts
- */
-Glyph* Font::getGlyphMetrics(Uint16 character)
-{
-  Glyph* rg = new Glyph;
-  rg->character = character;
+ * and MUST be deleted by the user..
+ *
+ * This only works for horizontal fonts. see
+ * http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html
+ * for more info about vertical Fonts
+ */
+bool Font::getGlyphMetrics(Glyph* glyph, Uint16 character)
+{
+  glyph->character = character;
   if (likely (this->fontTTF!= NULL))
   {
     int miX, maX, miY, maY, adv;
-    TTF_GlyphMetrics(this->fontTTF, rg->character,
+    if (TTF_GlyphMetrics(this->fontTTF, glyph->character,
                      &miX, &maX,
                      &miY, &maY,
-                     &adv);
-    printf("%c:: %d %d %d %d %d\n", 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;
-  rg->bearingX = (rg->advance - rg->width) / 2;
-  rg->bearingY = rg->maxY;
-  return rg;
+                     &adv) == -1)
+      return false;
+
+    glyph->minX = (float)miX / (float)this->renderSize;
+    glyph->maxX = (float)maX / (float)this->renderSize;
+    glyph->minY = (float)miY / (float)this->renderSize;
+    glyph->maxY = (float)maY / (float)this->renderSize;
+    glyph->advance = (float)adv / (float)this->renderSize;
+
+    // Calculate the Rest.
+    glyph->height = glyph->maxY - glyph->minY;
+    glyph->width = glyph->maxX - glyph->minX;
+    glyph->bearingX = (glyph->advance - glyph->width) / 2;
+    glyph->bearingY = glyph->maxY;
+    return true;
+  }
+  return false;
 }
 
@@ -478,22 +482,11 @@
         SDL_FreeSurface(glyphSurf);
         tmpRect.x += glyphSurf->w+1; //(int)(tmpGlyph->advance * this->renderSize);
-
-        /*
-        // Outputting Glyphs to BMP-files.
-        char outname[1024];
-        if (i < 10)
-        sprintf( outname, "%s-glyph-00%d.bmp", this->getName(), i );
-        else if (i <100)
-        sprintf( outname, "%s-glyph-0%d.bmp", this->getName(), i );
-        else
-        sprintf( outname, "%s-glyph-%d.bmp", this->getName(), i );
-        SDL_SaveBMP(tmpSurf, outname);*/
       }
     }
   }
   // 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);
 
   if (this->setSurface(tmpSurf))
@@ -523,5 +516,12 @@
   {
     // setting up all the Glyphs we like.
-    glyphArray[i] = getGlyphMetrics(i);
+    Glyph* newGlyph = new Glyph;
+    if (getGlyphMetrics(newGlyph, i))
+      glyphArray[i] = newGlyph;
+    else
+    {
+      delete newGlyph;
+      glyphArray[i] = NULL;
+    }
   }
   return;
Index: trunk/src/lib/graphics/text_engine/font.h
===================================================================
--- trunk/src/lib/graphics/text_engine/font.h	(revision 7429)
+++ trunk/src/lib/graphics/text_engine/font.h	(revision 7430)
@@ -85,5 +85,5 @@
     int getMaxAscent() const;
     int getMaxDescent() const;
-    Glyph* getGlyphMetrics(Uint16 character);
+    bool getGlyphMetrics(Glyph* glyph, Uint16 character);
 
     bool createFastTexture();
