Font in TPaveText through gStyle

Hi Root-ers,
Does anybody know how to set-up a standard value for the font of TPaveText, i.e, something like:
gStyle->SetTPaveTextFont(12) ?

I’d like all my TPave boxes to have the same font, and I don’t want to specify it every time.

thanks, Peter.

Hi Peter,

To set the font size in pixels for general use you need fonts with precision 3, i.e. myStyle->SetTextFont(63); myStyle->SetTextSize(12); Cheers, Ilka

Hi Ilka,

Somehow TPaveText is not influenced by:


It’s still using the default font …

cheers, Peter

The only fonts you can set via gStyle are:

   SetLabelFont(Style_t font=62, Option_t *axis="X");
   SetTitleFont(Style_t font=62, Option_t *axis="X"); //set axis title font or pad title 
   SetStatFont(Style_t font=62) {fStatFont=font;}


So, the solution is to create “my-style” macro and set the fonts as Ilka suggested, without using gStyle ?

cheers, Peter

Just tried it. Does’nt work like this. It’s seems there’s no soluition…

Hi Peter,

The created TPaveText objects can use TStyle settings only if TPaveText class has UseCurrentStyle() method. Unfortunately that is not the case (I did not check before answering your post yesterday, sorry).

Cheers, Ilka