我真的需要知道这个。每个人(希望如此)都知道 dpi 在网络上无关紧要,无论您使用 4000 还是 1 dpi 保存和成像都没有关系,您的计算机只是显示它指向像素。 现在,pt 中的 css 和字体大小如何?许多网站说 windows 使用 96 dpi 而 mac 72 这意味着 1 pt 在 mac 上是 1 px 而在 windows 上是 1,333 px。 但这没有意义,操作系统与任何分辨率无关,只有屏幕有 PPI,没有 dpi。 ppi取决于屏幕。
1pt 在 mac 上是 1px,在 pc 上是 1,333px 是真的吗?
最佳答案
This is quite a good read on the subject
Points (pt): Points are traditionally used in print media (anything that is to be printed on paper, etc.). One point is equal to 1/72 of an inch. Points are much like pixels, in that they are fixed-size units and cannot scale in size.
The so-called absolute units (cm, mm, in, pt and pc) mean the same in CSS as everywhere else. A length expressed in any of these will appear as exactly that size (within the precision of the hardware and software). They are not recommended for use on screen, because screen sizes vary so much. A big screen may be 60cm (24in), a small, portable screen is maybe only 8cm. And you don't look at them from the same distance.
The relation between the absolute units is as follows: 1in = 2.54cm = 25.4mm = 72pt = 6pc
因此,在 72 PPI(每英寸像素)显示器上,1 像素 = 1 点,因此在 Mac 上如果 PPI 为 72,则 1pt = 1px,在 Windows 机器上如果 PPI 为 96,则 1pt = 1.3 'px.
The 72 for mac and 96 for Windows are only defaults但是,可能会因可用的硬件和系统设置而异。
Points are not for print exclusively. Theoretically, points are for defining an absolute measure. Pixels are not absolute, since depending on your screen and chosen definition (not resolution), the resolution (pixels per inch) can go from a lot (150dpi) or very little (75dpi). Which means your pixels can be a size, or maybe half that size. Which means that text you design to be perfectly legible on your screen may look too big on your client’s screen (“please make the text smaller, ok?”) or too small to be readable on your neighbor’s screen (“hey, the website you told me about the other day? the one you said you had worked on… well i couldn’t read the text very well, it’s so small”).
Points are a solution to this issue. But browsers and operating systems need to manage those. Basically, it means:
browsers have to calculate the display size in pixels using the given value (say, 10pt) and the screen’s real resolution; operating systems have to communicate the real current resolution, and not a default value.
关于css - 1pt有多大?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22477561/