It used to be that if you created a TextLayout with a font render context that

indicated the use of antialiasing, rendering that TextLayout would render with
antialiasing. However, it seems that some JVMs don't do that, so we need to
manually enable antialiasing before rendering the TextLayout. Such are the
millions of tiny inconsistencies that undermine write once run anywhere.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2276 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2008-02-29 20:11:03 +00:00
parent 8b7610f188
commit 195c16e06a
@@ -30,6 +30,8 @@ import javax.swing.JComponent;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import com.samskivert.swing.util.SwingUtil;
/** /**
* A Swing component that displays a {@link Label}. * A Swing component that displays a {@link Label}.
*/ */
@@ -248,7 +250,14 @@ public class MultiLineLabel extends JComponent
} }
// draw the label // draw the label
Object oalias = null;
if (_antialiased) {
oalias = SwingUtil.activateAntiAliasing(gfx);
}
_label.render(gfx, dx, dy); _label.render(gfx, dx, dy);
if (_antialiased) {
SwingUtil.restoreAntiAliasing(gfx, oalias);
}
} }
// documentation inherited // documentation inherited