[open] Slow text rendering
It seems that canvas.text (or form.label, or even a feedback item referencing an experiment variable) take a long time to render when the text is quite long. On the order of 10 seconds for about 100 words... The feedback item is the quickest of all these options, but it's still very slow. (Also, I notice that the feedback text label doesn't wrap Chinese text, which is a deal breaker.)
The text is instructional text, so it is static. However, my experiment has been designed to be bilingual, where you choose the language at the start and then it loads the appropriate instructions (i.e., so it can't be prepared during experiment startup).
Is my only viable workaround to create a feedback item with several hardcoded labels, with appropriate "Show If" conditions (i.e., show this label if my language variable is X, show another if it is Y, etc.)?
Thanks;
C
Comments
Hi!
What back-end are you using now? Psycho and Legacy seem to be a lot faster than xpyriment when it comes to text rendering.
You could prepare both the Chinese and English (?) text in the prepare-tab of an inline-script item. Than in the run-tab, you could show either of them (with canvas.text() for example) dependent on the language that was chosen.
Oh and if you are going to use Legacy and you'll be using a multiple-choice item to determine the language, you might want to enable the custom cursor (in the Back-end settings). Otherwise it won't work (on my computer at least).
Hope this helps!
Hi,
I was using xpyriment. I tried with Psycho, but that broke my other tasks; fortunately, Legacy didn't break anything and sped things up considerably...enough for it to be usable. Thank you
It's still not wrapping Chinese text, but I can force that with manual line feeds.
Could you give an example of this? I.e. what should happen, and what does actually happen in OpenSesame?
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
I think the problem is due to written Chinese not containing any whitespace characters, so it doesn't know where it can wrap.
Here's a minimal demonstration
The English text correctly wraps before/at the nearest space to the
max_width. The Chinese text just runs off the screen.Thanks;
C
You could try this:
Instead of:
Then put spaces where you want them and adjust the font-size a little so it will fit on the screen.
Hi anonymouse,
That's basically what I've done to workaround the issue: My source text has manual linefeeds in it where it reaches the
max_width. It's a bit awkward to go through the text to place the linefeeds appropriately, but not a huge problem for nowThanks;
C
I figured as much. But there must be rules for how Chinese text should wrap, right? From Wikipedia it looks like it's ok to wrap after any character, with the exception that a handful of characters (mostly punctuation) are not allowed at the start of a line.
Is my understanding correct? If so, this wouldn't be to hard to implement in OpenSesame.
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
I'm not a native Chinese speaker, but yes, that is my understanding of how it works