What does size “1em” in Qt qss mean, if there is no font size em?

拥有回忆 提交于 2019-12-23 14:48:15

问题


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:

  • This answer says: 12pt = 16px = 1em = 100% ,but it also says, it depends on the context (whatever context may mean there)
  • Here it gives an approximate overview: http://www.sherriwyche.com/tools/fontconversion.html
  • and here the same question answered.

来源:https://stackoverflow.com/questions/33963809/what-does-size-1em-in-qt-qss-mean-if-there-is-no-font-size-em

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!