Text outline in figure

Hi experts,

Is there a way to create some outlined text in a TCanvas, like in the attached image?
I am using ROOT 6.30, and have looked around TText, TLatex and TPaveText with no luck.

Thanks in advance,
Lida

outline

Hi Lida,

I am not sure we support this kind of fonts. I perhaps let @olivier comment given his deep knowledge of the matter.

Cheers,
D

Some previous discussions:

Yes, we do not have this kind of font.

There is one possible way but it will work only for PostScript files and will required the editing of the PS file. It is the following:

  1. generate a PostScript file, for instance by running the following macro:
void outlinetext() {
   auto c = new TCanvas;
   auto t1 = new TText(.5,.5,"Outline text");
   t1->Draw();
   c->Print("c.ps");
}
  1. open the generated PosScript file (here c.ps) with your favourite text editor.

  2. after the line:

%%BeginProlog

insert the line:

/oshow {gsave [] 0 setdash true charpath stroke grestore} def
  1. Then search the text you want to see as hollow. In c.ps you will find something like:
... (Outline text) show  ...
  1. replace show by oshow and the text will appear as you wish in the Postscript file.

Hi all,

Thanks for the suggestion! I will try this PostScript alternative.

Cheers,
Lida

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.