SciSnap! question - width of text on an image pad

Hi ! i wrote text on an ImagePad with this block:
SciSnap-Window v1.04 script pic

How could i determine the width of this text on the ImagePad. The font isn't monospace like with the Write block...


Thank you !

Hi @emodrow , can you help me plz?

Good question! I'll include it in the next version. For now, the following block will help (if JavaScript is enabled):

Oh, sorry, the block is a reporter, so better use
instead of report SciSnap! error.

Thank you very much.

At the same time, maybe adding an "height of text" block!

here`s the script pic of the block

width of text

It work well if the text is already displayed on the image pad, but i want to know the width before displaying the image pad...

(the window as a default width, but if the title is too long, i will be able to enlarge the window)

If you can't know the width of a string without displaying it, i can redraw the window after displaying it if the title is to large...

There are a few style attributes that affect the text length. Redrawing is therefore probably the easiest thing to do. If it bothers you, you can hide the ImagePad after initialization.

ok, thank you for your time

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.