可以在网页中呈现的最大字体大小是多少?
它取决于机器还是应用程序(浏览器)?
它因浏览器而异。例如,Mac/IE4+ 不呈现指定 >255px 的字体。Opera 5 在 510px 之后出现异常。Mozilla 似乎能够处理高达 9362px 的值,这恰好也是 Netscape 4 的限制。
是的。
每个设备都有一些它支持的字体和字体大小。对于台式计算机,这两个集合都非常大,但对于电话或其他小型设备,集合可能相当有限。对于具有纯文本屏幕的设备,一种尺寸可能只有一种字体。
在 Firefox 3.6 中,最大实际字体大小似乎是 2000 像素。计算出的高度/行高上限约为 2657 像素,进一步增加不会改变显示。
Safari 5 和 Chrome 6(Webkit 浏览器)似乎允许最大(但不包括)1,000,000 像素的大小,在此之后文本根本不会呈现。
如果您使用内联 SVG,Chrome 会将字体大小限制为 8000px 。以下代码将在 firefox (V 59) 内联工作。Chrome (V 66) 将呈现以下 inline-svg 不可读。
<svg id="diagrammChart"
width="100%"
height="100%"
viewBox="-400000 0 1000000 550000"
font-size="27559"
overflow="hidden"
preserveAspectRatio="xMidYMid meet"
>
<g class="hover-check">
<text class="hover-toggle" x="-16800" y="36857.506818182" opacity="1" height="24390.997159091" width="953959" font-size="27559">
<set attributeName="opacity" to="1" begin="ExampShow56TestBarRect1.touchstart"
end="ExampShow56TestBarRect1.touchend">
</set>
<set attributeName="opacity" to="1" begin="ExampShow56TestBarRect1.mouseover"
end="ExampShow56TestBarRect1.mouseout">
</set>
Heinz: -16800
</text>
<rect class="hover-rect" x="-16800" y="12466.509659091" width="16800" height="24390.997159091" fill="darkred">
<set attributeName="opacity" to="0.1" begin="ExampShow56TestBarRect1.mouseover"
end="ExampShow56TestBarRect1.mouseout">
</set>
<set attributeName="opacity" to="0.1" begin="ExampShow56TestBarRect1.touchstart"
end="ExampShow56TestBarRect1.touchend">
</set>
</rect>
<rect id="ExampShow56TestBarRect1" x="-384261" y="0" width="953959" height="48781.994318182"
opacity="0">
</rect>
</g>
</svg>
大概两者兼而有之。它还取决于查看网页的显示器的大小。您想了解任何特定的应用程序吗?