[Solved] Problems with fonts on ROOT 5.28/00

Dear all,
I have problems with fonts since I have installed the version 5.28/00 of Root.
I am joining some files to show you the problem.
As a test, a used the macro available on the page :

TCanvas c(“c”,“c”,0,0,400,100);
TLatex t0(.05,.45,“Symbol: #font[122]{abc} - Symbol Italic #font[152]{abc}”);

I cannot attach the “symbolitalic.svg” file, but you can see the problem. The file Screenshot.png is showing all the files, plus the model I am supposed to see (at the center). On the .pdf and .ps files, the font is bigger than expected, and there is overlap between letters. On the .gif files, the font is in italic, small and greek letters are not taken into account. I tried to change fonts in my rootlogon.C file, but nothing has changed. Do you know where does it come from? Sorry if the problem is not related to Root, but all has changed when I have upgraded the root version.

Thanks in advance for your answer.

Best regards,


symbolitalic.ps (3.59 KB)
symbolitalic.pdf (12.1 KB)

I do not see the problem with the SVN trunk on linux. I get the attached files.
I will try with 5.28.
symbolitalic.ps (3.58 KB)
symbolitalic.pdf (12.1 KB)

I just tried with 5.28 (patches) on my linux box and all is fine.
On which machine are you running. It looks like ubuntu… right ?

What do you have against Ubuntu? :mrgreen:
I tried this code myself yesterday, too. :unamused:
All the graphical output is fine on an Ubuntu 10.04.2 LTS, i686, gcc 4.4.3 with ROOT 5.28/00b (svn revision 38685).
I have no idea what the cause of this problem can be, sorry. :-k

I have nothing against ubuntu but if you look closely the to screen dump E_Pierre posted it really looks like an unbutu system. So, good to know you have no problems on unbutu. Thanks :slight_smile:

Good morning,

thanks to look at my problem.
Yes, I am using Ubuntu 10.04.
To see if the problem comes from my version of Root, I returned to the former version I have on my computer using set_root_version (5.26/00d)
I ran the same small script with both versions (5.26/00d and 5.28/00). Files produced are attached. As you can see, with my 5.28/00, the font is different. What can I do to solve this problem? Sorry, I am a beginner in root…

Thanks !


Have you a rootlogon.C file ?
start root with the option -n (root -n) and try again.

No that the old version does not look very good either on your machine.

Yes I have a rootlogon.C file.
When I start Root with the -n option, it does not change anything, I obtained the same (I did the test with the symbolitalic files) .


The only thing that comes to my mind is that … it is possible that the machine is missing some “magic” font.
When ROOT tries to figure out where to put characters in a ps/pdf output, it probably uses some kind of a “font metric” (to estimate the length of the first “Symbol:” text, for example) and when the “magic” font is missing, it uses incorrect values (“default”?, coming from another font that it actually uses?).

BTW. I did not really test the “.svg” output - the standard “display” command doesn’t display Greek letters at all (it displays a single “?” character in this place). When viewed by “Mozilla Firefox 3.6.16”, it displays the “alpha” only (no “beta”, nor “chi”).

[...] > diff symbolitalic.good.ps symbolitalic.bad.ps 
< %%Creator: ROOT Version 5.28/00b
< %%CreationDate: Fri Apr  1 12:26:21 2011
> %%Creator: ROOT Version 5.28/00
> %%CreationDate: Thu Mar 31 20:43:32 2011
<  gsave  0 0 t black[  ] 0 sd 3 lw 0.95 0.95 0.95 c 2948 536 0 0 bf 1 1 1 c 0 0 m 8 8 d 520 Y 2932 X 8 8 d -2948 X -536 Y f 0.665 0.665 0.665 c 0 0 m 8 8 d 2932 X 520 Y 8 8 d -536 Y -2948 X f black
<  gsave  2948 536 0 0 C 2486.47 245.669 t 0 r /Symbol findfont 178.669 sf 0 0 m ita (abc) show gr NC gr 
<  gsave  2948 536 0 0 C 1183.68 245.669 t 0 r /Helvetica-Bold findfont 178.669 sf 0 0 m ( \255 Symbol Italic ) show NC gr 
<  gsave  2948 536 0 0 C 878.454 245.669 t 0 r /Symbol findfont 178.669 sf 0 0 m (abc) show NC gr 
<  gsave  2948 536 0 0 C 141.446 245.669 t 0 r /Helvetica-Bold findfont 178.669 sf 0 0 m (Symbol: ) show NC gr  gr showpage
>  gsave  0 0 t black[  ] 0 sd 3 lw 0.999 0.999 0.999 c 2948 536 0 0 bf black
>  gsave  2948 536 0 0 C 1302.81 245.688 t 0 r /Symbol findfont 178.669 sf 0 0 m ita (abc) show gr NC gr 
>  gsave  2948 536 0 0 C 588.125 245.688 t 0 r /Helvetica-Bold findfont 178.669 sf 0 0 m ( \255 Symbol Italic ) show NC gr 
>  gsave  2948 536 0 0 C 454.125 245.688 t 0 r /Symbol findfont 178.669 sf 0 0 m (abc) show NC gr 
>  gsave  2948 536 0 0 C 141.438 245.688 t 0 r /Helvetica-Bold findfont 178.669 sf 0 0 m (Symbol: ) show NC gr  gr showpage

The PS output relies on the TTF fonts to place the characters. The diff between your PS file and a good one clearly shows that the X position of the character is not good in your case. As ROOT is the same, the faulty part can only be the fonts on your machines. That’s confirmed by the fact the old version you show looks ugly too: it is not the expected fonts. Have you installed ROOT from the sources or are you using a pre-compiled module ? Are the fonts correctly installed on your machine ?
are you using the fonts in $ROOTSYS/fonts ?

Something just came to my mind.
Ubuntu provides ROOT 5.18 binary packages. These packages install "/etc/root/" configuration files (or maybe it was “/etc/system.rootrc”, I don’t remember now). Maybe you have them there and they contain “improper” entries for fonts (i.e. pointing to the non-installed on your system Ubuntu ROOT 5.18 related font packages).
Try these two commands:
ls /etc|grep -i root
ls /etc/.
|grep -i root
(Note: the latter command will find one “root” … this is the “/etc/…/root”, however, i.e. “/root”, don’t bother; any other found entry should be inspected.)

I don’t really know how this version was installed, I did not installed it by myself (it was done by the IT service of my lab). I assume fonts are well installed on my machine (I never observed any problem), and it seems I am using the good fonts (It is what it is written in my .rootrc:

Path where to look for TrueType fonst

Unix..Root.UseTTFonts: true
.Root.TTFontPath: $(ROOTSYS)/ttf/fonts

But I had a look in my $(ROOTSYS), and the folder ttf do not exist! So I changed to $(ROOTSYS)/fonts and I am going to test this evening.

If the problem is solved, I will edit my initial topic.

By the way, thanks !


In this case I would ask them to uninstall all Ubuntu ROOT 5.18 related packages at all.
Sooner or later you will face another problems related to these configuration files, as your own ROOT will parse them (and it will try to reference files/features they point to).

Start the “System” -> “Administration” -> “Synaptic Package Manager”, in the “Quick search” field type two words “cern root”, select all found packages (that are installed) and “mark” them all for the “complete removal” (accepting all additional required changes, if required), click the “Apply” button.

Pepe Le Pew: I think you are right, I will discuss about that with the IT.

So I have tested, and it work. The first file is with the bad path for the font, the second file is with the new path.

So thank you very much for the help, I don’t know why I had problem with this .rootrc file… But it is solved, it is the main thing.


There is something I don’t understand now.
What happens if you remove your private “.rootrc” file at all?
Do you then get proper ROOT behavior or not?
If yes, then there is no problem with the “/etc/root/*” configuration files (and you just have improper entries in your private “.rootrc” file).
If not, then there is a problem in ROOT - it unconditionally reads “system wide” configuration files, which may belong to a completely different version.

If I remove my .rootrc, then it is working.
So it seems the problem came from my .rootrc file…