Java vertical string

2009-06-15

To create a vertical string using the Graphics2D, use the following function to get a vertical font...

Code: (Java)

private java.awt.Font getVerticalFont(java.awt.Font source) {
// Create a rotation transformation for the font.
java.awt.geom.AffineTransform at = new java.awt.geom.AffineTransform();

// turn 90 degrees to the left (right-most part goes up)...
at.rotate(-Math.PI/2.0);

// create the vertical font
return source.deriveFont(at);
}


Hope it helps ya :)