Angstrom symbol refuses to render correctly using TLatex

I am trying to make a plot where the axis label includes the symbol for Angstrom #AA. This symbol keeps getting rendered as the symbol for “approximately equal”, namely #approx. This macro used to work with ROOT 5.34.25 which is the version I had installed. I tried 6.06 but it doesn’t help. There must be something screwy on my MAC with rendering stuff from the Symbol font. Other symbols such as Greek letters are okay, although I haven’t done an exhaustive check. Any suggestions.

Thanks Liz

Yes you are right. I just check. That’s only on screen with the Cocoa version of ROOT . If you use the X11 version or save the image as PDF it is OK. We will look into that.

So I am using XQuartz on MAC 10.9.5 and I built from source. If I save it as PDF then I also see the symbol correctly but not if I save as a PNG file and not on the screen.

By the way, on a completely unrelated note. ROOT 6.06 does not pick up changes to a script if I edit it and then rerun it. I have to quit the session. Unloading it doesn’t seem to work.

Liz

By default on mac when you build ROOT the cocoa backend is used. This has the problem. To use the Quartz backend you should configure root with cmake using -Dcocoa=OFF -Dx11=ON options. We are now looking at this problem for cocoa. Obfully it will be fixed soon.

When you have a new question it is better to make a new post otherwise the forum becomes very confusing.
Any way this is a known issue: sft.its.cern.ch/jira/browse/ROOT-7858

Now fixed. Thanks to have seen it.

Thanks. Is there a fixed version that I can download?

Liz

ROOT 6 master.

If you install ROOT from source I can send you the few line to add.

Yes I did so that would be very useful.

Thanks Liz

in $ROOTSYS/graf2d/graf/src/TLatex.cxx search for the text string “Angstrom” and replace:

      if(opSpec == 75 || opSpec == 76) {
         newSpec.fFont = GetTextFont();
         if (opSpec == 75) letter = '\305'; // AA Angstroem
         if (opSpec == 76) letter = '\345'; // aa Angstroem
      }

by:

      if(opSpec == 75 || opSpec == 76) {
         newSpec.fFont = GetTextFont();
         if (gVirtualX->InheritsFrom("TGCocoa")) {
            if (opSpec == 75) letter = '\201'; // AA Angstroem
            if (opSpec == 76) letter = '\214'; // aa Angstroem
         } else {
            if (opSpec == 75) letter = '\305'; // AA Angstroem
            if (opSpec == 76) letter = '\345'; // aa Angstroem
         }
      }