Welcome! Log In Create A New Profile

Advanced

How to show Chinese with TextGraphic?

Posted by Kevin_Zhang 
How to show Chinese with TextGraphic?
August 27, 2023 10:39AM
Hi All,
I want to show Chinese sentences by TextGraphic but what it showed is clobber. I tried to change the FontFace in this adapter to the font that can show Chinese such as Microsoft YaHei, but nothing happened, still clobber are showed, can anyone help me to figure out this question? Thanks a lot!
Re: How to show Chinese with TextGraphic?
August 28, 2023 01:23AM
Hi,
You can first convert the Chinese sentences into images and then display them as pictures, which is something I used to do when using Psychtoolbox.
By the way, are you planning to show Chinese to monkeys? Can they recognize text?

MoonL
Re: How to show Chinese with TextGraphic?
August 28, 2023 04:49AM
Yeah I just come out the same method just like you, but I still want to know if I can show Chinese by TextGraphic. For your second question, this time I just use ML as a tool to write a demo task for human subjects before deadline because I'm not familiar with PTB, not for formal research. By the way, is that can be accepted if I replace PTB with ML in formal psychophysic research?
Re: How to show Chinese with TextGraphic?
August 28, 2023 07:32AM
Download NIMH ML again and turn on UTF-8 system encoding like the following. To get to this menu in Windows 11, go to [Settings] - [Time & language] - [Language & region] - [Administrative language settings] and click on [Change system locale...]. In the resulting window, check on "Use Unicode UTF-8 for worldwide language support". There is no need to change the "Current system locale". Then click "OK" and reboot the computer.

Attachments:
open | download - locale.png (38.9 KB)
Re: How to show Chinese with TextGraphic?
August 28, 2023 11:22PM
Thanks for your answer Jaewon, but there still exists something wrong
Attachments:
open | download - Code.png (44 KB)
open | download - subject screen.png (8.3 KB)
Re: How to show Chinese with TextGraphic?
August 29, 2023 03:25AM
Please upload your timing file. There is nothing I can look into with the captured images.

Did you type those letters in the MATLAB editor? What is the version of your MATLAB?
Re: How to show Chinese with TextGraphic?
August 29, 2023 04:40AM
Here is my timing file, and yes I type it in MATLAB editor, my MATLAB version is 2022a
Attachments:
open | download - demo.m (579 bytes)
open | download - demo.txt (116 bytes)
Re: How to show Chinese with TextGraphic?
August 29, 2023 05:36AM
I do not see any problem in your files and they work fine in my computer. It seems that the length of the string is not correctly returned on your system, but I have no clue at the moment why it happens. Maybe it is related to the locale of your Windows or MATLAB. The support for unicode has been very poor in MATLAB, so it may take time to find a workaround or a solution may not exist.

Attachments:
open | download - Chinese.png (1.7 KB)
Re: How to show Chinese with TextGraphic?
August 29, 2023 06:01AM
Okay, Thank you so much for your patient and solution!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.