Howdy, Stranger!

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

Supported by

[solved] Justify text

edited December 2015 in OpenSesame

Hi!

I'm making some experiments that require several text display. I'm using the sketchap wiith
but I think there's a better way to make the tex easy to read. Does something like <div align="justify"> </div> work?

Thank you : )

Comments

  • edited 11:25AM

    Hi Guido,

    I'm afraid not! Only a subset of HTML tags is supported, as described here:

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 11:25AM

    Hi,

    let me first thank you for the software and the active follow-up with users :)

    So, there is no way to justify text in OpenSesame ?

  • edited 11:25AM

    Hi,

    There may be other ways to display text justified, but the only one I can think of would require a bit of coding. Basically you would add words to a string and check after every addition if the size of the string would cross a certain threshold, like max_width = 200. Once that happens, you would put the string minus the last word onto the canvas, but with a separate command for each word (e.g. in a for-loop). For each word you indicate the x-coordinate, and the coordinates will be calculated based on the size of individual words (using commands such as these: http://osdoc.cogsci.nl/python/canvas/#function-__canvastext_size__text-max_widthnone-style_args) so that the size of the complete string will match max_width.

    If you do this, you'd basically end up with a function to display text justified. @Sebastiaan, maybe we could implement this function ourselves?

    Cheers

    Josh

  • edited 11:25AM

    Hi Josh,

    Yes, that's a good idea. Maybe something for 3.1? This would probably be an extension of libopensesame.html.html.render().

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.