如何将字体大小设置为确切的物理大小? [英] How to set font size to exact physical size?

查看:62
本文介绍了如何将字体大小设置为确切的物理大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对CSS单位感到非常困惑.我只想知道一件事:

I am confusing about css units a lot. I just want to know one thing:

如果我希望我的文本的字体大小在任何设备和任何情况下实际都为4毫米.

If I want my text's font-size is exact 4mm physically in any devices and any cases.

我该怎么办?

推荐答案

同时存在锚定单元,它不是基于物理像素而是基于 参考像素 .

While there is the mm unit in CSS, it does not necessarily reflect the real physical size when being shown on a screen. There is no way to ensure exact physical dimensions on all devices and all cases. CSS units for screen media are anchored to the px unit which is not based on physical pixels but on the reference pixel.

参考像素是像素密度为96dpi且与阅读器的距离为一臂之长的设备上一个像素的视角.因此,对于标称长度为28英寸的手臂,其可视角度约为0.0213度.对于臂长阅读,因此1px相当于大约0.26毫米(1/96英寸).

The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm’s length. For a nominal arm’s length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm’s length, 1px thus corresponds to about 0.26 mm (1/96 inch).

参考像素因此高度取决于您所使用的设备,并且可能会或可能不会导致正确的物理尺寸.

The reference pixel thus highly depends on the device you are using and it may or may not result in correct physical dimensions.

这篇关于如何将字体大小设置为确切的物理大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆