View RSS Feed

Java AWT

Displaying Antialiased Text by Using Rendering Hints

Rate this Entry
by , 03-07-2012 at 04:48 PM (1066 Views)
Rendering hints may affect the Java 2Dô text.

Text drawing method that is the most important of all is given as following:
Java Code:
Graphics.drawString(String s, int x, int y);
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.

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);

Submit "Displaying Antialiased Text by Using Rendering Hints" to Facebook Submit "Displaying Antialiased Text by Using Rendering Hints" to Digg Submit "Displaying Antialiased Text by Using Rendering Hints" to del.icio.us Submit "Displaying Antialiased Text by Using Rendering Hints" to StumbleUpon Submit "Displaying Antialiased Text by Using Rendering Hints" to Google

Categories
Graphics

Comments