Anyone have an example snippet showing how to scale a Font using AffineTransform?
Thanks.
Anyone have an example snippet showing how to scale a Font using AffineTransform?
Thanks.
From memory:
Font tallerFont = font.deriveFont(AffineTransform.getScaleInstance(1.0, 2.0));
Well, you don't really need an AffineTransform to do a simple font scale. You can use Font.deriveFont(float size)
to geet a new `Font object with the specified size.
But I suppose you could use AffineTransform.getScaleInstance(double sx, double sy)
and apply the transform to your Graphics2D
object (assuming you have one) if you'd rather. It really depends on what you're doing.