0

这个问题是对以下问题的跟进:

为什么上标数字的 Unicode 字符显示高度不一样?

我想找到一种常用的字体,或者更好的字体堆栈,它可以一致地显示数字子和上标 Unicode 字符。这些以 HTML 表示:

⁰¹²³⁴⁵⁶⁷⁸⁹
₀₁₂₃₄₅₆₇₈₉

⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉

使用 Chrome/Windows 上的标准 SO 字体堆栈,上标 1 2 和 3 看起来与其他数字不同。我怎样才能找到一种始终显示所有这些字形的字体?还是我应该使用一组更好的 Unicode 字符?如果可以避免的话,我不想使用<sup>或其他样式。<span>

4

1 回答 1

1

Check out the font coverage pages at fileformat.info, such as the page on superscript four: http://www.fileformat.info/info/unicode/char/2074/fontsupport.htm

We can expect a font that contains superscript four to contain all the superscript digits from zero to nine, though it does not hurt to check this after picking up your font candidate. Similarly, a font that contains subscript four also contains the other subscript digits.

Among the fonts, Lucide Sans Unicode is probably the only one that is fairly universally available on Windows systems. Among serif fonts, Palatino Linotype is generally but not universally available.

In any case, for HTML documents, it’s a good idea to list down alternative fonts in CSS. For example, if you use <span class=sup>&#x2074;</span> and your overall text font is a serif font (for mathematical texts, serif fonts are generally preferable), you could have a CSS rule like

.sup { font-family: Cambria, Palatino Linotype, 
       DejaVu Serif, Gentium, Symbola, Code2000; }

There is a small chance that none of the listed fonts contains the superscript. Then the browser should fall back to some available font, but especially older versions of IE often fail to do that. Therefore you might consider putting Lucida Sans Unicode at the end of the list.

于 2012-01-05T11:06:29.250 回答