Chinese text does not have break lines

OS : Win10
PsychoPy version: 2021.2.3
What are you trying to achieve?:

I am trying to get the Chinese text with instructions for my experiment to fit on the screen. Right now the text is shown in one line/sentence and large parts of it were not shown at all. This does not happen for the Dutch text when I tried to put that in my experiment.

The Chinese text that is shown as followed:
Chinese Text

And the Dutch text with the layout that I would like to have:
Dutch Text

What did you try to make it work?:
I have tried to change the font to ‘Simsun’. I have also tried to change the wrap width and the alignment, but nothing works.

Thanks in advance for your consideration!

Try adding ‘\n’ (without quotation) to the specific parts of your string which overflow so that it gives a line break and resumes the text on the upcoming line.

text = 'Hello, this experiment was brought to you\n by the flying dutchman'

would be displayed as:

Hello, this experiment was brought to you
by the flying dutchman

Thank you for the solution! It worked perfectly for the instruction text part. However, for my experiment I also have some questions, which comes after the stimuli. These questions are in the Excel file, and I have added the line breaks to it. It works, but in the text it will show ‘\n’. I think this is because the line break is not added in the code part, but in the Excel file itself. Is there a way to solve this?

I think you can add line breaks on the excel sheet by just moving to a new line in the cell which contains your text. Try holding ALT and pressing ENTER to move to a new line.

1 Like

Oohh of course! The solution for both was much easier than I first thought. Thank you so much! Now I can finish my experiment.