The number returned by Font.getNumGlyphs()

后端 未结 1 368
眼角桃花
眼角桃花 2021-01-24 06:36

What does the number returned by Font.getNumGlyphs() actually represent?

The docs. state:

Returns the number of glyphs in this

相关标签:
1条回答
  • 2021-01-24 07:10

    <face-palm /> Right there at the top of the docs. for Font..

    Characters and Glyphs

    A character is a symbol that represents an item such as a letter, a digit, or punctuation in an abstract way. For example, 'g', LATIN SMALL LETTER G, is a character.

    A glyph is a shape used to render a character or a sequence of characters. In simple writing systems, such as Latin, typically one glyph represents one character. In general, however, characters and glyphs do not have one-to-one correspondence. For example, the character 'á' LATIN SMALL LETTER A WITH ACUTE, can be represented by two glyphs: one for 'a' and one for '´'. On the other hand, the two-character string "fi" can be represented by a single glyph, an "fi" ligature. In complex writing systems, such as Arabic or the South and South-East Asian writing systems, the relationship between characters and glyphs can be more complicated and involve context-dependent selection of glyphs as well as glyph reordering. A font encapsulates the collection of glyphs needed to render a selected set of characters as well as the tables needed to map sequences of characters to corresponding sequences of glyphs.

    Well, you learn something new every day. That was my 'learn item of the day'.

    0 讨论(0)
提交回复
热议问题