Why the display of Unicode characters for superscr

2020-01-29 17:48发布

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?

2条回答
Juvenile、少年°
2楼-- · 2020-01-29 18:20

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.

查看更多
Explosion°爆炸
3楼-- · 2020-01-29 18:38

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)
查看更多
登录 后发表回答