Index: trunk/MagicSoft/Mars/mtools/MCalendar.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MCalendar.cc	(revision 7893)
+++ trunk/MagicSoft/Mars/mtools/MCalendar.cc	(revision 7894)
@@ -1538,5 +1538,4 @@
 #define __CINT__
 #include <TTF.h>
-
 TASImage *MCalendar::DrawTTF(Float_t x1, Float_t x2, Float_t y1, Float_t y2,
                              const char *text, Float_t sz, const char *font)
@@ -1546,25 +1545,18 @@
         return NULL;
 
-    const Int_t size = TMath::Nint(sz*941);
+    const UInt_t size = TMath::Nint(sz*941);
 
     TTF::SetTextFont(file);
     TTF::SetTextSize(size);
 
+    UInt_t wi, hi;
+    TTF::GetTextExtent(wi, hi, (char*)text);
+
+    const FT_BBox &box = TTF::GetBox();
+
     delete file;
 
-    UInt_t wi, hi;;
-    TTF::GetTextExtent(wi, hi, (char*)text);
-
-    const FT_BBox &box = TTF::GetBox();
-    //cout << hi-box.yMax << " " <<   wi << " "<< (float)size/hi << endl;
-    //wi = wi;//TMath::Nint((float)wi*(size+hi-box.yMax)/size);
-    //wi += TMath::Nint(((float)size/hi-1)*wi);
-
-    const UInt_t add = size-box.yMax;
-
-    wi += size*(hi+add)/hi;
-    hi += add;
-    // wi += size*(hi+size-box.yMax)/hi;
-    // hi += size-box.yMax;
+    if (size>hi)
+        hi = size;
 
     TASImage img(wi, hi);
@@ -1577,6 +1569,9 @@
     Double_t h = gPad->PixeltoY(hi)/2;
 
-    // gROOT->GetColor(kBlack)->AsHexString()
-    DrawDate(img, 0, 0, text, size, "#00000000", font);
+    // This is the bounding box of the text
+    // If this box is not drawn part of the text disappears magically!
+    img.DrawBox(box.xMin, size, box.xMax, size-hi, "#ffffff");
+
+    DrawDate(img, 0, box.yMin, text, size, "#000000", font);
     return DrawImage(img, x-w, y-h, x+w, y+h);
 }
