What does size "1em" in Qt qss mean, if there is no font size em?
Asked Answered
I

0

6

As of Qt 5 documentation says:

The supported units are: px: pixels pt: the size of one point (i.e., 1/72 of an inch) em: the em width of the font (i.e., the width of 'M') ex: the ex width of the font (i.e., the height of 'x') However, Qt is limited to font sizes in pt and px and any other size must be in px, em or ex.

When they say 1em is equivalent "M", which M do they mean? Which font and pt size do they take to calculate that? Based on some other answers I can speculate it is some 12pt font, but which?

The question has a background: Our Qt application has a normal user experience under Windows and Linux, but on Mac OS the fonts appear tiny. If I was able to figure out the relation of pt to em, I could set a better font default for MacOS.

em to pt conversions:

Innoxious answered 27/11, 2015 at 19:32 Comment(2)
"M" means the width of a letter "M" drawn with the font of current context.Sonde
@RnMss, that seems like an answer to the question. Why a comment?Ability

© 2022 - 2024 — McMap. All rights reserved.