Skip to content

Commit

Permalink
give test.ttf font proper name in standard location. Fix rose_image.C to
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FonsRademakers committed Dec 7, 2004
1 parent 5d4c834 commit 8be55b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
File renamed without changes.
11 changes: 9 additions & 2 deletions tutorials/rose_image.C
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 8be55b4

Please sign in to comment.