Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7893)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7894)
@@ -18,4 +18,15 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2006/08/20 Thomas Bretz
+
+   * mtools/MCalendar.cc:
+     - fixed the font-size issue (which I don't understand at all -
+       bug report submitted)
+
+   * macros/tutorials/calendar.C:
+     - changed the font name to a font supported by root
+
+
+
  2006/08/19 Thomas Bretz
 
@@ -32,4 +43,22 @@
      mpointing/MPointingPos.cc, mbase/MEvtLoop.cc:
      - replaced MString::Form by new function name MString::Format
+
+   * macros/tutorials/calendar.C, macros/tutorials/calendar.rc,
+     macros/tutorials/holidays.rc:
+     - added
+
+   * mtools/MCalendar.[h,cc]:
+     - added some dead code
+     - changed the default a little bit
+     - added fOrientation to allow changing the orientation
+     - added code to paint a clock for the change from summer- to
+       winter-time and vice versa
+     - removed the direct dependance on the word "Easter" to
+       display the easter holidays
+     - added the possibility to restrict the display of some contents
+       to only some week days (eg to display "KW35" only on mondays)
+     - some updated to drawing the image
+     - improved the ResetLayout and SetDefaultLayout if called from
+       the context menu
 
 
Index: trunk/MagicSoft/Mars/macros/tutorials/calendar.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/calendar.C	(revision 7893)
+++ trunk/MagicSoft/Mars/macros/tutorials/calendar.C	(revision 7894)
@@ -141,8 +141,10 @@
         c.cd();
 
+        // "comic" is the ttf-font name. You find other ones typically
+        // in $ROOTSYS/fonts or /usr/X11R6/lib/X11/fonts/truetype
         if (hor)
-            cal->DrawTTFDate(0.64, 0.83, 1, 1, "%B %Y", 0.072, "minynbi_");
+            cal->DrawTTFDate(0.64, 0.83, 1, 1, "%B %Y", 0.072, "comic");
         else
-            cal->DrawTTFDate(0.5, 0.83, 1, 1, "%B %Y", 0.085, "minynbi_");
+            cal->DrawTTFDate(0.5, 0.83, 1, 1, "%B %Y", 0.085, "comic");
 
 
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);
 }
