TMathText in PDF/SVG export

Hi everyone,

Exporting TMathText objects (also implicitly in labels using “…”-syntax) does not work when saving as PDF or SVG.
Searching the forums, I found [url=https://root-forum.cern.ch/t/no-latex-text-in-exported-pdf/16285/1 topic, where it is said that this is known and not [i]implemented yet[/i].
This was two years ago. Are there any plans on including that feature?

It would be really nice, because TMathText is way more powerful than TLatex and looks much better. But I guess not being able to export this as SVG and especially PDF is a reason for not using it for many people.

Are there any technical obstacles concerning the implementation?
If not, I could have a look into the code myself and try to implement it, when I find the time.
I’d just need a pointer to a good starting point :wink:

Best,
Johannes

Yes we know… still not there. The author of this code did not have time to do it. PDF is tricky to do.

Yes sure you can have a look to it. Start from The PS version…

“Tricky” does not sound too promising…

I only now found time to have a look into the code, but I’m not really experienced in navigating in the root code.
I guess these are the important parts, but I did not really figure out, where the magic happens.

TMathText::PaintMathText() TPad::Paint() TVirtualPS / TPostScript
Could you point me to the code-parts for PS, for which the equivalents would have to be implemented for PDF?

in $ROOTSYS/graf2d/mathtext/src/

fontembedps.cxx

in $ROOTSYS/graf2d/postscript/src/:

TPostScript.cxx

and TPDF.cxx in which date text painting

void TPDF::Text(Double_t, Double_t, const wchar_t *)

should be implemented.
Now dummy …