0

When I use DrawFormattedText (using Matlab 2018a on a Windows 10 PC) to present text on screen, only the bottom 2/3 of the text is visible. I never had this issue on a Mac, but I don't have a Mac machine to test it out on.

I have tried searching for an answer to my question, and found this thread that has the exact same problem...

Psychtoolbox - Text for Instruction

Unfortunately, there is no clear answer to the problem on that thread, but I am experiencing the exact same thing.

When I use the code provided in that thread, I still get the same problem (the top 1/3 of my text is not visible).

Here's the code...

screenNum = max(Screen('Screens'));
window = Screen('OpenWindow', screenNum, 0);
white = WhiteIndex(window);
Screen('TextSize', window, 20);
Screen('TextFont', window, 'Courier');
DrawFormattedText(window, 'Hello World', 'center', 'center', white)
Screen('Flip', window);
imageArray = Screen('GetImage', window);
WaitSecs(3);
Screen('CloseAll');
imwrite(imageArray, 'testImage.png');

When I run this code, I do not see the top 1/3 of the text (just like the original poster on the linked question).

Psychologeek
  • 641
  • 1
  • 5
  • 8
  • This sounds like some Psychtoolbox configuration may not be installed correctly. Are there any Psychtoolbox debug, info, warning messages, etc. printed to the console when you run the above example? – DMR Jun 11 '19 at 15:04
  • Unfortunately, no... but I have made a little bit of progress. I found a thread on GitHub (essentially) suggesting that installing GStreamer would fix the problem. Unfortunately, intalling GStreamer actually makes the problem much worse. When I run the same code with GStreamer installed, the screen goes blank and I have to quit Matlab manually by forcing it closed via the Task Manager. I think the GStreamer thing might be a good lead, but I can't work out why my setup dislikes it so much. – Psychologeek Jun 11 '19 at 16:54
  • Actually, that is not altogether thrue - when I run the above code on its own, I am instructed to SkipSyncTests. When I do this, the code works fine, but the top part of the text goes missing. Essentially, my only options at this stage seem to be: (1) have the top part of the text missing, or (2) have the whole thing crash. – Psychologeek Jun 11 '19 at 17:00
  • UPDATE: I have now pretty much started the whole process from scratch. I restored my laptop to before GStreamer was installed, then I reinstalled it. A few tests and a lot of patience, and it seems to be working fine now. It turns out that where I thought GStreamer had broken PTB, it was just taking a (very) long time to update everything. Once it had run once (and performed all necessary updates), the text started to display properly and does so every time now. If anybody else has this problem, install GStreamer and when the screen goes blank, BE PATIENT! Eventually, it will work just fine. – Psychologeek Jun 11 '19 at 22:34

1 Answers1

0

I've had the same situation. After I removed gstreamer and installed a lower version (I ran help GStreamer and it will tell you what version you should download) and SetupPsychtoolbox, then it was able to display the full text. But unfortunately the Chinese characters don't show up anymore (I'm a Chinese student)

FFF FF
  • 1