Index: /trunk/src/lib/graphics/text_engine.cc
===================================================================
--- /trunk/src/lib/graphics/text_engine.cc	(revision 5336)
+++ /trunk/src/lib/graphics/text_engine.cc	(revision 5337)
@@ -257,12 +257,21 @@
   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE );
 
-  if(likely(type & TEXT_RENDER_DYNAMIC && this->font != NULL))
-    {
-      Glyph** glyphArray = this->font->getGlyphArray();
-      glBindTexture(GL_TEXTURE_2D, this->font->getFastTextureID());
-      //      glEnable(GL_TEXTURE_2D);
-      glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
+  if(likely(type & TEXT_RENDER_DYNAMIC ))
+    {
+      Glyph** glyphArray;
+      if (false /*likely (this->font != NULL)*/)
+      {
+        glyphArray = this->font->getGlyphArray();
+        glBindTexture(GL_TEXTURE_2D, font->getFastTextureID());
+      }
+      else
+      {
+        if (unlikely(Font::getDefaultFont() == NULL))
+          Font::initDefaultFont();
+        glyphArray = Font::getDefaultFont()->getGlyphArray();
+        glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getFastTextureID());
+      }
+        glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
 //      glRotatef(this->getAbsDir2D(), 0,0,1);
-
       const char* tmpText = this->externText;
       if (this->externText == NULL)
@@ -270,7 +279,7 @@
       if (likely(tmpText != NULL))
       {
-        while (*tmpText != '\0')
+        while (likely(*tmpText != '\0'))
         {
-          if(glyphArray[*tmpText])
+          if(likely(glyphArray[*tmpText] != NULL))
           {
             glCallList(glyphArray[*tmpText]->displayList);
@@ -473,6 +482,4 @@
 Font::~Font()
 {
-  // deleting the Lists of all Texts
-
   // deleting all Glyphs
   if (this->glyphArray != NULL)
@@ -542,15 +549,23 @@
 
   // initializing the Glyphs.
-  if (!this->glyphArray)
+  if (this->glyphArray == NULL)
   {
     float cx,cy;
+    Glyph* glyph;
     this->glyphArray = new Glyph*[FONT_HIGHEST_KNOWN_CHAR];
     for (int i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++)
     {
-      this->glyphArray[i] = new Glyph;
-      this->glyphArray[i]->displayList = glGenLists(1);
+      glyph = this->glyphArray[i] = new Glyph;
+      glyph->displayList = glGenLists(1);
+      if (!glIsList(glyph->displayList))
+      {
+        PRINTF(2)("Error creating glList for Font character %c\n", i);
+        this->glyphArray[i] = NULL;
+        delete glyph;
+        continue;
+      }
       cx=(float)(i%16)/16.0f;                  // X Position Of Current Character
       cy=(float)(i/16)/16.0f;                  // Y Position Of Current Character
-      glNewList(this->glyphArray[i]->displayList, GL_COMPILE); // Start Building A List
+      glNewList(glyph->displayList, GL_COMPILE); // Start Building A List
        glBegin(GL_QUADS);                           // Use A Quad For Each Character
         glTexCoord2f(cx,1.0f-cy-0.0625f);            // Texture Coord (Bottom Left)
@@ -565,5 +580,4 @@
 //       glTranslated(12,0,0);                        // Move To The Right Of The Character
       glEndList();                                 // Done Building The Display List
-
       this->glyphArray[i]->width = 12;
     }
@@ -988,5 +1002,4 @@
 
       TextEngine::checkVersion();
-      Font::initDefaultFont();
     }
   else
Index: /trunk/src/lib/graphics/text_engine.h
===================================================================
--- /trunk/src/lib/graphics/text_engine.h	(revision 5336)
+++ /trunk/src/lib/graphics/text_engine.h	(revision 5337)
@@ -177,7 +177,7 @@
 
   /** @returns a Pointer to the Array of Glyphs */
-  inline Glyph** getGlyphArray() const { return glyphArray; };
+  inline Glyph** getGlyphArray() const { return this->glyphArray; };
   /** @returns the texture to the fast-texture */
-  inline GLuint getFastTextureID() const { return fastTextureID; };
+  inline GLuint getFastTextureID() const { return this->fastTextureID; };
   /** @returns the default Font */
   inline static Font* getDefaultFont() { return Font::defaultFont; };
