In Java, text is expressed as a series of Unicode characters. Unicode is a standardized list of characters matched up with 16-bit character codes. The Unicode standard includes character codes for the characters that are used in most of the world's written languages. For more information, visit http://www.unicode.org/. Java uses 16-bit Unicode characters in its char type. Strings, furthermore, are an array of Unicode characters.
Rendering text is the task of finding shapes that correspond to characters and rendering the shapes on a drawing surface. In the 2D API, this is the job of Graphics2D, the rendering engine.
The shapes that represent characters are called glyphs. Frequently there is a one-to-one correspondence between characters and glyphs, but not all the time. For example, the characters "f " and "i" each have a corresponding glyph. But sometimes, for aesthetic reasons, "f " and "i" together are represented by a single glyph, called a ligature. An example of a ligature is shown in Figure 6.1. Notice how the dot on the "i" has been combined with the ball on the "f " to create an efficient representation of the two characters.
Furthermore, different glyphs may be used for a single character depending on the character's context. This is true in Arabic writing, ...