# Text Size Ouput Panel Viewer

**URL:** <https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561>\
**Category:** Getting Started\
**Created:** [November 17, 2021, 6:43pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561 "2021-11-17T18:43:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![specfiction](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@specfiction](https://geant4-forum.web.cern.ch/u/specfiction)\
**Post date:** [November 17, 2021, 6:43pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/1 "2021-11-17T18:43:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![allison](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@allison](https://geant4-forum.web.cern.ch/u/allison)\
**Post date:** [November 18, 2021, 10:20am UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/2 "2021-11-18T10:20:05Z")

</div>

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](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Control/commands.html). 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.

---

<div class="post-metadata">

**Author:** ![specfiction](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@specfiction](https://geant4-forum.web.cern.ch/u/specfiction)\
**Post date:** [November 18, 2021, 7:56pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/3 "2021-11-18T19:56:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![allison](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@allison](https://geant4-forum.web.cern.ch/u/allison)\
**Post date:** [November 18, 2021, 9:32pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/4 "2021-11-18T21:32:27Z")

</div>

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).

```auto
--- 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.

John

 ![Screenshot 2021-11-18 at 21.30.55](https://geant4-forum.web.cern.ch/uploads/default/original/2X/8/84e7c54dd1c521be22cb86f699e755bb60a15536.png)

---

<div class="post-metadata">

**Author:** ![specfiction](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@specfiction](https://geant4-forum.web.cern.ch/u/specfiction)\
**Post date:** [November 18, 2021, 10:03pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/5 "2021-11-18T22:03:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![allison](https://geant4-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/90db22/32.png) [@allison](https://geant4-forum.web.cern.ch/u/allison)\
**Post date:** [November 18, 2021, 10:20pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/6 "2021-11-18T22:20:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://geant4-forum.web.cern.ch/uploads/default/original/1X/ce519a43ebdf7ac48a98a03c6ad6eea013b68c46.png) [@system](https://geant4-forum.web.cern.ch/u/system)\
**Post date:** [February 16, 2022, 10:21pm UTC](https://geant4-forum.web.cern.ch/t/text-size-ouput-panel-viewer/6561/7 "2022-02-16T22:21:06Z")

</div>

Closed on February 16, 2022, 10:21pm UTC

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