Font size to pixel
hello, I am conducting a visual acuity experiment and I should convert the size of letters (in fon Sloan) to px and then have a value in arcmin. The size of the letters is set like that because based on the performance they increase or decrease. Can anyone give me a formula or conversion method?
thank you very much
Comments
Hi @fcosta00 ,
The above line of code indeed returns the font size in pixels. For most fonts, font size refers to the height of the 'x' character. To, in turn, convert pixels to degrees of freedom (and, in turn, minutes of arc), see for example here:
Does this help?
Cheers,
Lotje
Did you like my answer? Feel free to

@lvanderlinden I don't know, I tried measuring the letter when presented and it measures 179px (I set 250 with the previous line. Do you know why?
Hi @fcosta00 ,
I'm afraid that we need some more specific information. How did you measure "the letter"?
Just note that pixels only refer to the height (not the width) of the letters and that most fonts (and also the QFont class that OpenSesame uses) use the 'x' as the reference character.
If you need more specific help, please explain to us (1) how you manipulate the font size and (2) how you managed to measure it.
Cheers,
Lotje
Did you like my answer? Feel free to

hi @lvanderlinden,
to change the font size i used the above line of code my_canvas['char'].font_size =250. This is the command used and is called every trial with a size that varies from trial to trial. the font used is a SLOAN font (this one: denispelli/Eye-Chart-Fonts (github.com)). For the measurement I simply made a screenshot at full resolution and then measured with editing programs the size of the letters