[solved] Justify text
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
Hi Guido,
I'm afraid not! Only a subset of HTML tags is supported, as described here:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
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 ?
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 matchmax_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
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
Check out SigmundAI.eu for our OpenSesame AI assistant!