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
@@ -3,7 +3,7 @@
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001-2007 Michael Bayne
//
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
@@ -30,6 +30,8 @@ import javax.swing.JComponent;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import com.samskivert.swing.util.SwingUtil;
/**
* A Swing component that displays a {@link Label}.
*/
@@ -248,7 +250,14 @@ public class MultiLineLabel extends JComponent
}
// draw the label
Object oalias = null;
if (_antialiased) {
oalias = SwingUtil.activateAntiAliasing(gfx);
}
_label.render(gfx, dx, dy);
if (_antialiased) {
SwingUtil.restoreAntiAliasing(gfx, oalias);
}
}
// documentation inherited