Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Slow text rendering

edited August 2015 in OpenSesame

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

  • edited 8:17AM

    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!

  • edited 8:17AM

    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.

  • edited 8:17AM

    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?

  • edited August 2015

    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

  • edited 8:17AM

    You could try this:

    text = """chinese text """
    

    Instead of:

    text = u'chinese text'
    

    Then put spaces where you want them and adjust the font-size a little so it will fit on the screen.

  • edited 8:17AM

    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 now :)

    Thanks;
    C

  • edited August 2015

    The English text correctly wraps before/at the nearest space to the max_width. The Chinese text just runs off the screen.

    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.

  • edited 8:17AM

    Hi Sebastiaan,

    I'm not a native Chinese speaker, but yes, that is my understanding of how it works :)

Sign In or Register to comment.