WRITE __ SIZE __ algorithm

What is the algorithm used to determine the matrix dimensions for the WRITE block?

I need to determine the pixels for a given letter at a certain size, ideally 5x5 or 6x5.
I have been writing a letter, make it a costume, export the costume and see what the width & height is in Paint or some program like that. But it is cumbersome and tedious.

I'd like to know programatically, in a few iterations, how to achieve the 5x5 or 5x6 or 6x6 type of pixel list.

If you clear the stage and do the WRITE, you can
untitled script pic
and similarly width. This assumes that you've written the text pointing at 90 degrees; what you get is the bounding box height or width, which will be different at an angle.

Thanks but that is not what I need. The whole issue is, NOT writing, making a costume., and then measuring!
When write executes it does not do those things. At each point size it produces a different size letter matrix. I was asking for that algorithm.

Ah, I thought it was the exporting to other software part that bothered you. The making a costume part can be done in a Snap! program, so there's no manual step involved.

I believe the rendering of text is done by the browser; Snap! doesn't turn characters into pixels. So there's nothing we know that you don't. :~)