What exactly is UIFont's point size?

后端 未结 5 1723
予麋鹿
予麋鹿 2020-12-23 12:36

I am struggling to understand exactly what the point size in UIFont means. It\'s not pixels and it doesn\'t appear to be the standard definition of point which

5条回答
  •  情书的邮戳
    2020-12-23 13:27

    A font has an internal coordinate system, think of it as a unit square, within which a glyph's vector coordinates are specified at whatever arbitrary size accommodates all the glyphs in the font +- any amount of margin the font designer chooses.

    At 72.0 points the font's unit square is one inch. Glyph x of font y has an arbitrary size in relation to this inch square. Thus a font designer can make a font that appears large or small in relation to other fonts. This is part of the font's 'character'.

    So, drawing an 'A' at 72 points tells you that it will be twice as high as an 'A' drawn at 36 points in the same font - and absolutely nothing else about what the actual bitmap size will be.

    ie For a given font the only way to determine the relationship between point size and pixels is to measure it.

提交回复
热议问题