GUI dpi scaling?

Hello,

What’s the expected way to do dpi scaling in the ROOT GUI?
I have a high-resolution screen and the GUI is tiny.

Thanks,
Andreas

Hi Andreas,

You can try to increase the font size in $(ROOTSYS)/etc/system.rootrc or in your own custom ~/.rootrc

Cheers, Bertrand.

Hi Bertrand,

This does help! What about radio and checkbox buttons. How do I scale them?

Thanks,
Andreas

Hi Andreas,

You can’t. They are based on pixmaps, and there is no way to scale such components…

Cheers, Bertrand.

Hi Bertrand,

With the wide-spread use of Retina/4K displays in the near future, are there any plans to change this?

Another question: Is there any possibility to change the default font size in the GUI programatically, and not just in .rootrc?

Thanks,
Andreas

[quote=“acz”]With the wide-spread use of Retina/4K displays in the near future, are there any plans to change this?[/quote]Well, yes, but this requires deep, low-level changes in the way gui is rendered, but yes, gui modernization is planned (not only for high resolution display).

[quote=“acz”]Another question: Is there any possibility to change the default font size in the GUI programatically, and not just in .rootrc?[/quote]Yes, you can set the font for each widget (check the SetFont() methogs in the GUI classes). Or by using TEnv::SetValue(). For example:

gEnv->SetValue("Gui.DefaultFont", "-*-helvetica-medium-r-*-*-24-*-*-*-*-*-iso8859-1");
But you have to do it at the very beginning of the application, before creating the TApplication instance.

Cheers, Bertrand.

Great! Thanks a lot!
Andreas

You’re very welcome! :slight_smile:
Cheers, B.

Hi, sorry for necrobumping, but I just installed ROOT on my new Lenovo Carbon X1 and have the same exact issue. It is well known that HiDPI support in Linux is still quite poor, but I managed to fix most of problems with GUI apps by increasing Xorg’s dpi setting as described e.g. here.

I wanted to know if there are any news about this issue. As most modern apps do, ROOT should respect the Xft.dpi setting.

Hi,

This issue will be solved by using the new, Web based ROOT7 GUI like the RBrowser. If you have a recent version of ROOT, you can already try it:

root [0] ROOT::Experimental::RBrowser b

Cheers, Bertrand.

Thanks!

For the record, things get better in the classic GUI by adding the following to .rootrc:

Gui.DefaultFont:            -*-helvetica-medium-r-*-*-24-*-*-*-*-*-iso8859-1
Gui.MenuFont:               -*-helvetica-medium-r-*-*-24-*-*-*-*-*-iso8859-1
Gui.MenuHiFont:             -*-helvetica-bold-r-*-*-24-*-*-*-*-*-iso8859-1
Gui.DocFixedFont:           -*-courier-medium-r-*-*-24-*-*-*-*-*-iso8859-1
Gui.DocPropFont:            -*-helvetica-medium-r-*-*-24-*-*-*-*-*-iso8859-1
Gui.IconFont:               -*-helvetica-medium-r-*-*-20-*-*-*-*-*-iso8859-1
Gui.StatusFont:             -*-helvetica-medium-r-*-*-20-*-*-*-*-*-iso8859-1
Browser.IconStyle:           big

and the following to .rootlogon.C:


    gStyle->SetCanvasDefH(2*gStyle->GetCanvasDefH());
    gStyle->SetCanvasDefW(2*gStyle->GetCanvasDefW());
    gStyle->SetFrameBorderSize(2*gStyle->GetFrameBorderSize());
    gStyle->SetFrameLineWidth(2*gStyle->GetFrameLineWidth());
    gStyle->SetFuncWidth(2*gStyle->GetFuncWidth());
    gStyle->SetGridWidth(2*gStyle->GetGridWidth());
    gStyle->SetHistLineWidth(2*gStyle->GetHistLineWidth());

    // optional
    //gROOT->ForceStyle();
2 Likes

Thanks for sharing, this should probably be a FAQ :slight_smile: