Text Size Ouput Panel Viewer

The text size on the Output panel viewer in Opengl that comes up in the examples is very small (~9pt) with bad contrast. How does one increase the size and style of the font in the Output console? Thank you.

In general you can adjust things like size and colour. Use “help” or “ls” to see available commands and guidance about their parameters, or look at Built-in Commands — Book For Application Developers 10.7 documentation. For example, the 5th parameter of vis/scene/add/text is font_size. Also look at some of the vis.mac files in the examples for ideas.

There’s no way of changing the font style at the moment but this is coming in the next release with the new ToolsSG driver.

Not quite sure what you mean by “Output console”? I’m guessing you’re using the Qt GUI. Do you mean the sub-window that receives the Geant4 standard output? On my Mac, the font size looks more like 12pt. Short of hacking the Geant4 source code I don’t think there’s a way of changing the size.

I’m talking about the Output streaming window from Geant below the graphics window. Using the Qt GUI on Linux with high res monitor. Everything on the Gui window is small (~9pt fonts), and the Output font is small, light in contrast, and essentially useless if you’re trying to avoid eye strain. BTW on everything else on my system; editor, shell window, etc. all fonts are fine ~12pt good contrast, so this GUI is not inheriting from the system so it is set somewhere. Can anybody help with this?

If you’re prepared to edit Geant4 source and rebuild, the following makes the output very large and bold. It exploits the fact that output to Qt is in HTML (but I’m not very familiar with HTML).

--- a/source/interfaces/basic/src/G4UIQt.cc
+++ b/source/interfaces/basic/src/G4UIQt.cc
@@ -2148 +2148 @@ G4int G4UIQt::ReceiveG4cout (
-    aStringWithStyle = "<span style='font-family:courier;'>" + aStringWithStyle + "</span>";
+    aStringWithStyle = "<span style='font-family:courier;'><font size=\"20\"><b>" + aStringWithStyle + "</b></font></span>";

(This is in my development branch - the line numbers and even the code might be different in previous releases, but I hope you get the idea.)

You will need to fix it in two places, one for G4cout, one for G4cerr.

I guess there ought to be a command to change output font size.


Thanks for your efforts. I found another very simple solution that I hope will be generally useful for people. Turns out that you can globally scale Qt5 GUI’s just by exporting a scaling env variable:

Scale Qt5 App

export QT_SCALE_FACTOR=1.5

in your launch shell script. I tried it, the GUI has improved 100%. It now has ~12pt font with high contrast.

Ah, that’s great! Good to know. Well done - thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.