New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Hindi glyphs (with matras/ diacritics/ vowels) not displaying in any PsychoPy version (both coder and builder) #6135
Comments
Hi @MichaelWoodc, amazing. Thanks a lot for your help. Yes I can confirm that it is indeed correct rendering.
However, some more complex Hindi alphabets are still showing up as separate characters instead of coming up as a single glyph.
Rendering Hindi can be challenging due to its complex script, where multiple units combine to form a single glyph. The good news is that the program can now render individual characters, a task it was unable to do previously. |
Have you experimented with different backends for psychopy?
[image: image.png]
The previous issue was with pyglet, another backend may not have that
issue. In a quick experiment I was unable to switch the backend,
however. It may take a little bit of setup.
Have you considered using your own font file if that's possible? I am
not sure if you can just set these things as characters of your own
font so that they're not multibyte characters. Or perhaps even
displaying pictures of SVG if it doesn't need to be dynamically
updated. hopefully you find a workaround, fingers crossed for you!
…On Mon, Feb 26, 2024 at 9:54 AM Niket Agrawal ***@***.***> wrote:
Hi @MichaelWoodc <https://github.com/MichaelWoodc>, amazing. Thanks a lot
for your help. Yes I can confirm that it is indeed correct rendering.
word_to_display = "समर्पण" #displays incorrectly, स + म + र + ् + प + ण
word_to_display = "क्षत्रिय" #displays incorrectly, क + ् + ष + त + ् + र + ि + य
However, some more complex Hindi alphabets are still showing up as
separate characters instead of coming up as a single glyph.
Some examples are:
- र + ् + प = र्प
- क + ् + ष = क्ष
Rendering Hindi can be challenging due to its complex script, where
multiple units combine to form a single glyph. The good news is that the
program can now render individual characters, a task it was unable to do
previously.
—
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMHLGISMTHDB3I64JZTPXTTYVSO3HAVCNFSM6AAAAABBPZF44CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRUGMZTOMBZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks a lot. I tried to play with changing backends, For now we are using images as text stimuli but for eye-tracker and getting character level data, makes those images useless. Interestingly, OpenSesame library worked for us to render stimuli. Thanks a lot again for your help @MichaelWoodc |
Actually, I'm most interested in whether we could solve this with TextBox2 rather than TextStim. TextBox2 is written in-house which means we have complete control over how layout works, so we should be able to apply a fix like this ourselves rather than requesting the fix in pyglet. TextBox2 is also much faster to update text than TextStim. |
Oh, I wasn't aware of that. I'll try with some stimuli using TextBox2 and provide an update here. |
Just to be clear, I'm not thinking that TextBox2 already solves the issue - it needs each character manually laying out by us and i don't think we've handled this issues yet - but on the plus side the code to lay out the printable characters is only 20 lines long and is within our control meaning that a solution like @MichaelWoodc found could be very easy to implement here |
PsychoPy Version
2022.2.4
What OS are your PsychoPy running on?
Windows 10
Bug Description
We are facing this major issue with PsychoPy since last 3+ years that it is not able to display any character/string with matras/vowel sign.
It displays
कमल
correctly without any errors but crashes as soon as we add word with matraकमाल
It works correctly on Pavlovia (online environment) though. I guess because it offloads that task to web-fonts.
Let me first explain what is a matra :
In Hindi, a "matra" refers to the diacritical marks or vowel signs used in the script. Matras are an integral part of the script to convey accurate pronunciation. Matras do not mean anything on their own and need a "akshara" i.e. consonant to make proper syllable.
For example:
म
is (akshara or consonant) andा
is (matra or diacritic denoting vowel). When they combine, it forms a single but composite glyph likeम + ा = मा
These matras are very interesting and unique to Indian languages. Each matra have its own property and can be displayed all around the akshara/consonant, (
ी at right, ि at left, ै at top, ू at bottom etc.
, there are others too) and can even combine to make a akshara/consonant half. I'm mentioning some more such examples below:PsychoPy in its current form, is not able to display any of the Hindi characters. We currently rely on jsPsych or OpenSesame.
Expected Behaviour
Ideally, it should not crash and should display all the valid glyphs (vowels, consonants, conjuncts) correctly. Some documentation and in-depth discussion about ligature glyphs can be found at following links:
Steps to Reproduce
Reproduce with PsychoPy Builder (any version)
कमाल
Reproduce with PsychoPy Coder (any version)
Here is the code to reproduce the error, just comment/ uncomment relevant lines to see the error
Additional context
No response
The text was updated successfully, but these errors were encountered: