Tex Gyre fonts has a bad side effect ...
Check duplicate issues.
- [ ] Checked for duplicates
Description
As well explained in this forum post, the Tex Gyre fonts put in action by this PR on CMS demand have a very bad side effect: white spaces before special symbols like #pm are far too large. The following example shows the problem:
{
auto c = new TCanvas;
auto l1 = new TLatex(.1, 0.9, "A #pm #in B");
l1->SetTextFont(42);
l1->SetTextSize(0.05);
l1->Draw();
c->Print("file.ps");
c->Print("file.pdf");
}
For the time being, there is no obvious fix except reverting the PR.
Reproducer
see the forum post
ROOT version
= v6.32.00
Installation method
any
Operating system
all
Additional context
No response
Results of the latest investigation show that the problem lies in TTF::PrepareString. With the new font, the width of a whitespace is significantly larger than it was with the old one. The computation is done with:
(Int_t)((fgFace[fgCurFontIdx]->glyph->advance.x)>>6)
With the following code:
{
auto c = new TCanvas;
auto l1 = new TLatex(.1, 0.9, "A #alpha");
l1->SetTextFont(42);
l1->SetTextSize(0.05);
l1->Draw();
c->Print("file.ps");
}
This value in 19 with the new font whereas, it was 7 with the old one.
Fixed with https://github.com/root-project/root/pull/15971
Hi @couet,
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Sincerely, :robot:
Hi @couet,
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Sincerely, :robot:
Hi @couet,
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Sincerely, :robot: