How to display Bengali font for visual experiment

The Bengali font is not working in PsychoPy. I am using the latest version (2023.2.1). I want to perform a visual experiments where Bengali sentences will appear. Help me how to do it. I already tried one thing - that I download the Noto Sans Bengali font families from google font. Installed it in my PC. Changed the font in “text” stimuli in psychopy builder but it did not work. I also copied one .ttf file into the psychopy font folder. But still not working.

Are you referring to an offline or online experiment?


Offline experiment. It will be conducted on a desktop. Not online.

When you say “not working”, is it raising an error or just not displaying the font correctly? How does it look?

Just not displaying.

TypeError: ord() expected a character, but string of length 2 found
################# Experiment ended with exit code 1 [pid:7296] #################

I ran again. This is also an error massage.

Could you share the Bengali text you’re trying to display? From that error I’d guess it’s something to do with compound characters - possibly that PsychoPy is trying to find a single Unicode value for a character which comprises multiple values. With the text I’ll be able to test it out myself and get a better idea of what’s going on.

Yes. Here are my Bengali texts.

  1. তুমি লাল ব্যাগটা একটুর ধরো
  2. তোমরা ভাল করে বাক্সটা খোঁজো
  3. তোমরা এই প্রশ্নের উত্তরগুলো লিখো

And so on. . .

Perfect thanks, I’ll do some testing with these and let you know what I find!

Running this file:
testBengaliText.psyexp (9.6 KB)
in 2023.2.1 in Windows 11, with Noto Sans Bengali installed from here using the “Variable” .ttf file produces this:

Comparing this to the way the text looks when copying it into the Specimen field on Google Fonts it looks like there are a few characters out of place, is this what you’re referring to or are you getting an entirely different looking stimulus?

Yes. You are right. I have tried with this Noto Sans Bengali font. But here, it read as one character. So the string is not displaying.