Alert for randomizing font type on each trial

Hi all,

I am trying to randomize the font type on each trial of a task. Currently I have a list of fonts in a code component (e.g. fonttype = [‘Times New Roman’, ‘Arial’, ‘Calibri’]). I then shuffle(fonttype) and in the font options I have $fonttype[0] and set every repeat.

This seems to work but I get the ‘Alert’:
Alert 4320:Font $fonttype[0] not found locally, will check Google Fonts on next run.

Can anyone help fix this so I don’t get the alert? More importantly, is there a better way to randomize the font type on each trial?

Also, all the fonts in the list are downloaded locally.

Thanks in advance for your help!

Is this in Builder?

What version of PsychoPy?

The variable is being interpreted as a string? It might be possible to use text_2.sonttype[0])

Hi there,

Yes, it is in builder and it is version: v2021.2.3

I tried the $text_2.fonttype[0] but I still get the alert:

Alert 4320:Font $text_2.fonttype[0] not found locally, will check Google Fonts on next run.

Thanks for your help!