How to calculate the size and position of text (in pixels) that is presented using text display
I'm currently attempting to calculate the size and position of text presented using the form text display.
Our experiment consists of a loop which presents a sentence to participants (the sentence contents and size change every loop). Importantly, we use San Serif font, meaning that the size of each individual letter varies.
I want to calculate the size and position (in pixels) of each word in our sentences and then save these.
Any help would be hugely appreciated as I'm currently very stuck with this!
Comments
Hi Ryan,
Have yo seen this function: https://osdoc.cogsci.nl/3.3/manual/python/canvas/#function-canvas46text95size40text-centertrue-max95widthnone-4242style95args41
I think this should be helpful to solve your issue. If you need the size of every letter, you have to draw them separately.
Good luck,
Eduard