KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have found that while rendering opaque text in Java (latest version 6u23) uses sub-pixel AA just fine, rendering translucent text does not. Sub-pixel AA: The same text for which only the color has been changed from 0xFFFFFFFF to 0xBFFFFFFF: As you can see, the translucent text is clearly standard AA and rather than a clean translucent rendering, it has that awful '90s "spidery" appearance. Is this due to a technical limitation for sub-pixel AA in general, or a bug in Java, or just because Java doesn't even try for translucent text, or have I missed something? Graphics Initialization dbGraphics=(Graphics2D)dbImage.getGraphics(); if(dctRoot.properties.getBoolean("Antialias",true)) { try { Map hnts=(Map)(dctRoot.awtComponent.getToolkit().getDesktopProperty("awt.font.desktophints")); // SET AA ON OVERALL (NOTE: GENERAL AA MUST BE OFF FOR SUBPIXEL AA TO BE HONORED - TEXT WIDGETS MUST DO THIS THEMSELVES) dbGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); if(hnts!=null) { // SET FONT RENDERING HINTS FROM DESKTOP dbGraphics.addRenderingHints(hnts); } else { try { // SET TEXT AA TO FONT-SPECIFIED GASP AA (JAVA 6+) dbGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.class.getField("VALUE_TEXT_ANTIALIAS_GASP").get(null)); } catch(Throwable thr3) { // SET TEXT AA TO DEFAULT dbGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
Tags (comma-separated)
Save Edits
Cancel