The following code run using python3 -i test.py
causes the font in the displayed root window to be huge (first picture below):
import ROOT
canvas = ROOT.TCanvas()
latex = ROOT.TLatex()
latex.SetNDC()
latex.SetTextFont(61)
latex.DrawLatex(0.5,0.5,"MU")
canvas.SaveAs("test.pdf")
canvas.Modified()
canvas.Update()
The saved pdf file itself has the proper size font, as shown in the second image. The problem does not appear, if I for example use font 62 instead (but for example 60 also has the problem), save it as a .png file instead (or don’t save it at all), or if I set ROOT.gStyle.SetCanvasPreferGL(True)
in the beginning. Also clicking in the ROOT window on the center where the small font would be makes the font become the proper small size again (but only clicking on the very center, not on the whole big font area). This looks like a bug or maybe my system has some problems with fonts?
ROOT Version: 6.19.01
Platform: Ubuntu 18.04
Compiler: gcc 7.4
Python: 3.6.8