This system component is called a font renderer or a font rasterizer. He is responsible for converting the sequence of character codes into pixels based on the glyphs defined by the font. As other answers pointed out, the different character encoding values that you can get and set with Java don't matter. When the JVM provides the font visualizer with a sequence of character codes, it reports that the encoding is used (probably UTF16, but this is transparent to the Java programmer). The font renderer uses the font encoding specified in the font file to match the corresponding glyphs.
Current versions of Windows and Mac OS X come with excellent font renderers.
The first point of confusion is that the JRE comes with its own font renderer, as part of the Java2D platform, and this is what Swing uses. It should be possible to control whether Java uses its own renderer or system one.
EDIT:. Like McDowell mentioned in a comment, in OS X you can enable system rendering by setting the Java property apple.awt.graphics.UseQuartz = TRUE.
The second point of confusion is that ligatures are optional in English. A desktop publishing application replaces the league “ffl” (one character in a font) when it sees a word like “shuffle”, but most other applications do not bother. Based on what you said about Devanagari (and what I just read on Wikipedia), I collect ligatures that are not optional in this language.
By default, the Java2D font renderer does not perform ligatures. However, the JavaDoc for java.awt.font.TextAttribute.LIGATURES says that ligatures are always allowed for writing systems that require them. If this is not your experience, you may have found a bug in the Java2D font renderer. In the meantime, try using the Font constructor, which takes a font attribute map, including TextAttribute.LIGATURES.
source share