Trying to make the stimulus text displaying in different font sizes

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2022.1.3

Hi there,

I’m doing an experiment involved with Chinese-English mixed-languages sentences. The stimulus in each trial will be something like this: “老师taught me知识” (“teachers taught me knowledge”). My current issue is in any type of font (I’m using Microsoft YaHei here), the Chinese characters would be perceived bigger than the English words. I’ve been trying to find a way to display the words in different languages with different font sizes (either make English bigger or make Chinese smaller) so that the visual representation of each language would be perceived as the same, but so far I haven’t succeeded.

Does anyone have any idea how could I solve this issue? Any suggestions are welcome and appreciated. Thank you in advance!

Hi, in cases where you need specific formatting of words, I would recommend you converting them into images to be presented (e.g. writing out the text and formatting them in powerpoint and saving them as images).

1 Like

Thank you for your reply! That was my original plan, but I wasn’t sure about whether it could be done through coding. I think I’ll go with the pictures, but could you elaborate a bit about what the challenges of actualizing it through coding on PsychoPy?

If my understanding is correct, when you change the letter height of text /textbox component, it is done for all of the text and you cannot pick which one you want to edit.

As an option, you can have separate components, in this case 老师taught me知识, 3 components: 1 for 老师; 1 for taught me; 1 for 知识 and line them up into one line and manually edit the size so they are all consistent.

Alternatively, perhaps you can try a couple of other monospace font as listed in this link here html - How can I line up English and Chinese characters of a monospace font for CSS? - Stack Overflow

Hope this can get you started if you don’t want to go with the image route

1 Like

I tried to use separate columns in Excel and manually adjust the font size and location, then realized that it’s almost impossible to align them with the normal width space between words so that them would look natural. I also tried other fonts, and I do think Microsoft YaHei has done a good job. But what I concern here is not the actual size, but the size people perceive - Chinese characters “look bigger” when they are in the same size of English.

I guess using pictures is indeed the only solution so far. Thank you so much for all your replies! I really appreciate it.