字符小于Java中的空格?

时间:2017-05-08 19:35:24

标签: java string output

我用Java编写程序,我需要一个类似于空格的字符(""),除了显示时长度较小。理想情况下,角色的大小是空格角色的一半。

我想知道这样的角色是否存在,或者是否有办法让我修改空格字符的长度以使其在输出给用户时变小。

1 个答案:

答案 0 :(得分:2)

阅读this article。这可能会有所帮助:

U+0020  SPACE   foo bar Depends on font, typically 1/4 em, often adjusted
U+00A0  NO-BREAK SPACE  foo bar As a space, but often not adjusted
U+1680  OGHAM SPACE MARK    foo bar Unspecified; usually not really a space but a dash
U+180E  MONGOLIAN VOWEL SEPARATOR   foo᠎bar No width
U+2000  EN QUAD foo bar 1 en (= 1/2 em)
U+2001  EM QUAD foo bar 1 em (nominally, the height of the font)
U+2002  EN SPACE    foo bar 1 en (= 1/2 em)
U+2003  EM SPACE    foo bar 1 em
U+2004  THREE-PER-EM SPACE  foo bar 1/3 em
U+2005  FOUR-PER-EM SPACE   foo bar 1/4 em
U+2006  SIX-PER-EM SPACE    foo bar 1/6 em