Font size not linear conversion to pixel
hi, I am conducting a visual acuity experiment and I should convert the size of letters (in font 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. I used the above line of code my_canvas['char'].font_size =250 to change the font size. 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)). I tried measuring the letter when presented and it measures 179px (I set 250 with the last line). For the measurement, I simply made a screenshot at full resolution and then measured with editing programs the size of the letters. Do you know why? Can anyone give me a formula or an explanation for this phenomenon?
Comments
Hi @fcosta00 ,
The font size as specified in OpenSesame corresponds roughly to the distance in pixels between the top of the
bto the bottom of thep. However, you should think of this as a suggestion that is provided to the font, as opposed to an exact size, because the exact size varies from font to font and possibly even from letter to letter. In other words, fonts have a lot of freedom in how they are rendered.If you're interested, you can take a look at the
QFontdocumentation, which is what OpenSesame uses to render fonts on the desktop (in a browser,pixijsis used):So if the exact font size is crucial, then you indeed want to measure the actual size from a screenshot or something similar.
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!