Skip to content

[graf2d] support PDF output with mathtext - #23217

Draft
ferdymercury wants to merge 1 commit into
root-project:masterfrom
ferdymercury:mathtextpdf
Draft

[graf2d] support PDF output with mathtext#23217
ferdymercury wants to merge 1 commit into
root-project:masterfrom
ferdymercury:mathtextpdf

Conversation

@ferdymercury

@ferdymercury ferdymercury commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

To be applied after #23198

Fixes
https://root-forum.cern.ch/t/latin-l-with-tmathtext-and-pdf-issue/33205/10
https://root-forum.cern.ch/t/saveas-pdf-cannot-handle-tmathtext/38905
https://root-forum.cern.ch/t/tmathtext-in-pdf-svg-export/19505/4

It does not work yet, is just a placeholder for not forgetting, that's why skip-ci.

@couet since you have quite some expertise with TPDF, maybe you can give advice on this PR

@ferdymercury ferdymercury added the skip ci Skip the full builds on the actions runners label Sep 1, 2026
@ferdymercury ferdymercury changed the title [skip-ci][graf2d] support PDF output with mathtext [graf2d] support PDF output with mathtext Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 9ccd5c1.

♻️ This comment has been updated with latest results.

@linev

linev commented Sep 1, 2026

Copy link
Copy Markdown
Member

I do not think that we need to include extra fonts to support TMathText.
ROOT fonts are organized so that they are very close with default PDF fonts.

One only need to find right solution to remap wchar_t to symbols which can be understand by PDF.
For latin symbols it is trivial, for greek characters from symbols.ttf - more tricky.

We do not support loading of custom ttf fonts yet in ROOT graphics.
Only now we have code which consistently works on all platforms with TTF.
And only now we can start thinking to support custom fonts via loading of custom TTF files.
At the very end we could think how to integrate them into PS/PDF/TeX outputs.

@ferdymercury

ferdymercury commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

I do not think that we need to include extra fonts to support TMathText.

Ok, but TPostscript.cxx can stay as it is, right ? (With font mapping)
Or you want also to remove that part from TPostscript ?

@linev

linev commented Sep 1, 2026

Copy link
Copy Markdown
Member

It is only about PDF - here no extra fonts embed

@couet

couet commented Sep 1, 2026

Copy link
Copy Markdown
Member

In TPostScript some extra font are needed for special characters like \ell and many many others liste here https://root.cern/doc/master/classTMathText.html. TPDF will also need these extra fonts. TMathText was not implemented in TPDF because it is much more complex: a PS file has a linear structure whereas a PDF has an indexed one. As an example of complexity see the gymnastic I was obliged to do to implement the #url directive in TPDF (that was the last addon in TPDF).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip ci Skip the full builds on the actions runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants