From 8be55b426bc3c4e4dec7f7152f748f0b63114896 Mon Sep 17 00:00:00 2001 From: Fons Rademakers <Fons.Rademakers@cern.ch> Date: Tue, 7 Dec 2004 19:32:38 +0000 Subject: [PATCH] give test.ttf font proper name in standard location. Fix rose_image.C to use this new font name and make font lookup $ROOTYS independent (in case ROOT is installed in fixed --prefix location). git-svn-id: http://root.cern.ch/svn/root/trunk@10712 27541ba8-7e3a-0410-8455-c3a389f83636 --- tutorials/test.ttf => fonts/BlackChancery.ttf | Bin tutorials/rose_image.C | 11 +++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) rename tutorials/test.ttf => fonts/BlackChancery.ttf (100%) diff --git a/tutorials/test.ttf b/fonts/BlackChancery.ttf similarity index 100% rename from tutorials/test.ttf rename to fonts/BlackChancery.ttf diff --git a/tutorials/rose_image.C b/tutorials/rose_image.C index d3da41db241..31f2f1f74f4 100644 --- a/tutorials/rose_image.C +++ b/tutorials/rose_image.C @@ -19,11 +19,18 @@ void rose_image() img->SetConstRatio(0); img->SetImageQuality(TAttImage::kImgBest); + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString bc = fp + "/BlackChancery.ttf"; + TString ar = fp + "/arial.ttf"; + // draw text over image with funny font - img->DrawText(120, 160, "Hello World!", 32, gROOT->GetColor(4)->AsHexString(), "test.ttf", TImage::kShadeBelow); + img->DrawText(120, 160, "Hello World!", 32, + gROOT->GetColor(4)->AsHexString(), + bc, TImage::kShadeBelow); // draw text over image with foreground specified by pixmap - img->DrawText(250, 350, "goodbye cruel world ...", 24, 0, "$ROOTSYS/fonts/arial.ttf", TImage::kPlain, "fore.xpm"); + img->DrawText(250, 350, "goodbye cruel world ...", 24, 0, + ar, TImage::kPlain, "fore.xpm"); TImage *img2 = TImage::Open("mditestbg.xpm"); -- GitLab