My question relates to the underlying rendering mechanism. Does it use Windows APIs e.g. drawtext, exttextout or does it use a proprietary drawing mechanism? Is this documented anywhere?
More specifically
java.awt.Graphics.drawString
java.awt.Graphics2D.drawString
Under Sun JDK for windows
Actually, I’ve researched this when developping a PDF library.
Java, more specifically an implementation of Java, since it’s not part of the public java-API, has libraries for parsing font-files and returning so-called “glyphs”. These glyphs are then rendered using Graphics.
(Edit: glyphs are vectorgraphical (i.e.
java.awt.Shapes) components that make readible symbols (Latin charset for instance, but also Hebrew or Arabic).)To answer your question: it does not use Windows APIs such as drawtext. It may use Windows APIs to get font glyphs (depends on implementation of Java). As far as I know, Sun Java have closed-source font libraries which give you the glyphs.
You can, though, use glyphs provided by the libraries of any implementation of Java:
in
java.awt.Font.That should be a nice jumpstart. If you’d need anything: the rest is quite nicely documentated in the JavaDocs, i.e. http://java.sun.com/j2se/1.4.2/docs/api/java/awt/font/GlyphVector.html