Displaying Antialiased Text by Using Rendering Hints
by, 03-07-2012 at 05:48 PM (950 Views)
Rendering hints may affect the Java 2Dô text.
Text drawing method that is the most important of all is given as following:
Text antialiasing is a method which is used so that to smooth the text edges on screen. Applications are enabled by the Java 2D API to specify that such method shall be used or not and which algorithm shall be used by using text rendering hint, to the graphics.Java Code:Graphics.drawString(String s, int x, int y);
At the edge of text, blend of the most common rendering hint and text color takes place along with onscreen background pixels. An application shall invoke as following, for requesting this hint.
Java Code:graphics2D.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);