User Interface Window Text Missing

When using the Geant4 user interface window, the first letter of some sentences is missing. Even upon switching to ‘right to left’ reading order, the first letter is not there. Images attached below.
_Geant4 Version:4-11-2
_Operating System: Windows

It seems to only happen on lines that lack any indentation.

Any help would be appreciated…


Thankyou for bringing this to our attention. We are looking into it. Looks like a bug.


Yes, I can reproduce.

There is a bug in G4UIWin32::ConvertNewLines() to replace ‘\n’ by ‘\r\n’:

str.replace(index, 2, "\r\n");

should be:

str.replace(index, 1, "\r\n");

The story is that doing ‘\n’ in G4cout to go to a newline is a UNIX convention not known by the Windows WS_EX_CLIENTEDGE widget. The right portable way to do a new line should be by using std::endl, but probably too late to do changes in G4. Then to output to the Windows widget, we have to replace all the ‘\n’ by ‘\r\n’ (Bill wants that) in the received strings. And the problem is that the author of ConvertNewLines() misused std::string.replace() here…

Then, if you master your source code and G4 build, have a try with the upper modification.
The file to change is:


It works for me. I am going to look for a merge request…