| Reference | Downloads | Github

Newline in TextStim shows unknown character


Hello everyone,
for some reason ‘visual.TextStim’ has some trouble working as intended on my system. When I run the following code, ‘\n’ does not start a new line but shows up as a unknown character. Further the text seems to be smaller than usual by default but I am not sure about that and it can be fixed by argument ‘height’.

from psychopy import visual, core
win = visual.Window([400,400])
message = visual.TextStim(win, text='hello\nworld')
message.setAutoDraw(True)  # automatically draw every frame


system information

PsychoPy 1.83.04

numpy 1.13.3
scipy 0.18.1
matplotlib 2.0.0
pyglet 1.3.0
pyo version 0.8.2 (uses single precision)
pyo 0.8.2

Thank you for your help and have a nice day!


Was able to fix this by setting window type from Pygame to Pyglet.