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

发布于 2024-12-08 11:16:00 字数 95 浏览 1 评论 0原文

为什么 Unicode 数字上标的显示高度不一样?如果您用上标数字组成两位数,这一点尤其明显。其中一些看起来不错,但其余的看起来彼此格格不入。我错过了什么吗?或者事实就是如此?

Why the display of Unicodes for superscripts of digits are not at the same height? This is specially noticeable if you make two digit numbers out of the superscript digits. Some of them look fine but the rest look out of the place with respect to each other. Am I missing something? Or is this how it is?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

挽手叙旧 2024-12-15 11:16:00

就像jrturton 提到,1、2 和 3 来自旧字符集(拉丁语 1),因此包含在不同的位置。这也意味着很多字体不支持更多的上标数字,因为许多字体只支持拉丁文、希腊文和西里尔文,并添加一些标点符号。因此,其余的字体取自不同的字体,您可以使用该字体作者几乎没有控制权。

例如:

Superscriptnumbers

这些是从 1 到 9 和 0 的上标数字。文本的运行格式为 Arial在Word中。你看看其他人发生了什么。与 jrturton 认为的相反,没有对现有字形进行重塑。这只是字体替换。

Like jrturton mentions, ¹, ² and ³ were from a legacy character set (Latin 1) and therefore included in a different place. This also means that lots of fonts don't have support for more superscript numbers, as many only strive for Latin, Greek and Cyrillic with a few punctuation symbols thrown in. So the remaining ones are taken from a different font over which you as an author have little to no control.

As an example:

Superscript numbers

Those are the superscript numerals from 1 to 9 and 0. The run of text was formatted in Arial in Word. You see what happened to the rest of them. Contrary to what jrturton believes, there is no reshaping of existing glyphs involved. This is just font substitution.

时光是把杀猪刀 2024-12-15 11:16:00

不合适的(1,2 和 3)是在其余的之前添加的(请参阅维基百科:http:// en.wikipedia.org/wiki/Unicode_superscripts_and_subscripts),并且来自不同的 unicode 块。这并不能解释为什么它们看起来不同,但可能这些字符是大多数字体中的实际字符,而其余字符只是标准字形的调整版本。

看起来就是这样,你是对的,当你试图制作多位上标数字时,它看起来可怕。我不知道它是否适用于所有字体,但它在 iOS 系统字体上非常明显。

如果有人有办法让这项工作成功,我会在这个问题上悬赏。

更新

我编写了一个小程序来循环浏览手机上的所有字体并显示从 0 到 9 的上标数字。以下字体在所有数字上具有一致的外观:

  • Zapfino
  • Courier-Bold
  • AmericanTypewriter(也-粗体)
  • HiraKakuProN-W6(也-W3)
  • 值得注意-粗体(也-浅色)

The out of place ones (1,2 and 3) were added before the rest (see wikipedia: http://en.wikipedia.org/wiki/Unicode_superscripts_and_subscripts), and are from a different unicode block. That doesn't explain why they look different but it may be that those ones are actual characters in most fonts, and the remaining ones are just adjusted versions of the standard glyphs.

This appears to be how it is and you are right, it looks terrible when you are trying to make multi digit superscript numbers. I don't know if it applies to all fonts but it is very noticeable on the iOS system font.

If anyone has a way to make this work, I will put a bounty up on this question.

UPDATE

I knocked up a little program to cycle through all fonts on the phone and display the superscript numerals from 0 to 9. The following fonts had a consistent appearance across all digits:

  • Zapfino
  • Courier-Bold
  • AmericanTypewriter (also -Bold)
  • HiraKakuProN-W6 (also -W3)
  • Noteworthy-Bold (also -Light)
妳是的陽光 2024-12-15 11:16:00

只是为了添加更多数据,在某些情况下,即使字体中有明确的字形,它们也会被放置在错误的高度。 (我怀疑这是为了向后兼容,但我不知道历史。)

以下是 Helvetica Neue 在 macOS 13.2.1 上使用的字形:

Helvetica 上标字形digits

设计和尺寸匹配,但垂直偏移不同。

Just to add more data to this, in some cases even when there are explicit glyphs in the font, they are put at the wrong height. (My suspicion is that this is for backward compatibility, but I don't know the history.)

Here are the glyphs used by Helvetica Neue on macOS 13.2.1:

Helvetica Glyphs for superscript digits

The design and size matches, but the vertical offsets are different.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文