Embedded padding/margin in fonts

后端 未结 16 1226
执念已碎
执念已碎 2021-01-08 00:56

It seems that all fonts have some sort of embedded padding or margin. By setting:

margin: 0px;
padding: 0px;

You never get what you want. D

16条回答
  •  Happy的楠姐
    2021-01-08 01:21

    The reasons of this pecularity of the computer fonts are mostly historical. In the past, fonts were the sets of small metal blocks with one character on each, and the height of these blocks had to be enough to contain all the elements of any character, including descendants, ascendants and diacritical marks. The typographic tradition has defined the font size as the height of such metal blocks. That's why almost all actual characters are usually much smaller visually than the font size set for the text and there is some white space above and below them.

    Here is a good article explaining the historical roots of the main typographic measurements: http://www.dev-archive.net/articles/typograph1-en.html#Ch22

提交回复
热议问题