Changes in text size across PTB versions

Hi all,

 

Apologies if this issue has been raised before, I had a look through the forum and couldn't find anything.

 

I’m using PsychToolbox with Windows. I’ve recently updated PTB, and noticed that there seems to be a large difference in the size that on-screen text is drawn, using either DrawFormattedText or Screen(‘DrawText’). Under version 6399, this code:

 

MainWindow = Screen(1, 'OpenWindow');

[screenWidth, screenHeight] = Screen('WindowSize', MainWindow);

Screen('TextFont', MainWindow, 'Courier New');

Screen('TextStyle', MainWindow, 0);

Screen('TextSize', MainWindow, 28);

[nx, ~, ~] = DrawFormattedText(MainWindow, 'The quick brown fox jumped over the lazy dog', 0, 0);

 

Gives nx = 968. But the exact same code under version 7550 gives nx = 748. So the text in the newer version is rendered at around 3/4 of the size as in the older version. As noted above, this isn’t specific to DrawFormattedText since the same applies to DrawText. And I’ve tested it on three different systems with the same results each time.

 

So, my question is – is this a known issue, and if so is there a straightforward way to fix it so text appears at the same size across different versions of PTB? Or do I need to increase the TextSize of all my old programs so that text appears correctly in newer versions of PTB?

 

Thanks in advance

 

Mike

i think i can answer this. Mario may correct me.
Text sizes used to be highly inconsistent across platforms. Through a real engineering feat Mario recently managed to provide us with the same font rendering software across all platforms, so font rendering is now nearly platform independent. Alas, that means that the old platform idiosyncracies that old code was designed with are gone, and, as you observe size has changed. The changes primarily affect Windows, and affect unix not at all, and Macs very slightly.

I think it's worth the trouble to achieve platform independence. I write testing programs that clinics use on multiple platforms, and this makes life much easier.

best
denis


Denis Pelli
Professor of Psychology & Neural Science, New York University

On Mon, Apr 11, 2016 at 6:05 PM, Mike Le Pelley m.lepelley@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

Hi all,

Apologies if this issue has been raised before, I had a look through the forum and couldn't find anything.

I’m using PsychToolbox with Windows. I’ve recently updated PTB, and noticed that there seems to be a large difference in the size that on-screen text is drawn, using either DrawFormattedText or Screen(‘DrawText’). Under version 6399, this code:

MainWindow = Screen(1, 'OpenWindow');

[screenWidth, screenHeight] = Screen('WindowSize', MainWindow);

Screen('TextFont', MainWindow, 'Courier New');

Screen('TextStyle', MainWindow, 0);

Screen('TextSize', MainWindow, 28);

[nx, ~, ~] = DrawFormattedText(MainWindow, 'The quick brown fox jumped over the lazy dog', 0, 0);

Gives nx = 968. But the exact same code under version 7550 gives nx = 748. So the text in the newer version is rendered at around 3/4 of the size as in the older version. As noted above, this isn’t specific to DrawFormattedText since the same applies to DrawText. And I’ve tested it on three different systems with the same results each time.

So, my question is – is this a known issue, and if so is there a straightforward way to fix it so text appears at the same size across different versions of PTB? Or do I need to increase the TextSize of all my old programs so that text appears correctly in newer versions of PTB?

Thanks in advance

Mike


A simple solution and sound advice for the future - thanks Mario that's perfect! And thanks for all your work on PTB, it's appreciated.

Mike