Text rendering bug related to Tex GyreHeros font (again)

Describe the bug

It seems that the bug I previously reported here is back. In the following canvas, the # symbols which are precede by a space character are too distant from the character that comes before them.

The problem persists also if I print the canvas to a pdf file: file.pdf (12.4 KB).

Expected behavior

To Reproduce

gStyle->SetTextFont(42);
gStyle->SetTextSize(0.05);
TCanvas *c = new TCanvas;
TLatex l;
l.DrawLatexNDC(0.1, 0.9, "With space 123 #pm 456 123 < 456 123 #leq 456");
l.DrawLatexNDC(0.1, 0.8, "Without space 123#pm456 123<456 123#leq456");
c->Print("file.png");
c->Print("file.pdf", "pdf");

Setup

ROOT v6.32.04
Built for linuxx8664gcc on Aug 30 2024, 16:41:36
From heads/master@tags/v6-32-04
With c++ (GCC) 14.2.1 20240805
Binary directory: /usr/bin

Running on Arch linux, using the official root package, version 6.32.04-1.

Additional context

The problem is not present if I use, e.g., font number 1 (free serif).

I invite @couet to give us a hand on this.

I’ll check

I tried your example and I get the right output . For me the bug is fixed (master version on Mac)

Thanks for the quick check. I will try to update and see if it’s still present.

Tried version 6.32.06 from the official extra-testing repo, but I still see the issue.

Did PR#15971 end up in 6.32-06? The fix to the previous bug was there, but I can not find the definition of TTF::ComputeTrailingBlanksWidth(int) in the sources for 6.32-06.

It could be that this fix was not in that one yet.

Then I will compile master myself until it ends up in the official release. Thank you.

1 Like

Indeed it is clear on the PR page [1] that it is intended to appear in version 6.34 as you can see on the right side of this page. So for now, as you noticed, the way to get the fix is to get the master version or to compile ROOt yourself.

[1] Tex Gyre fonts has a bad side effect ... · Issue #15948 · root-project/root · GitHub

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