tags:

views:

175

answers:

2

Anyone have an example snippet showing how to scale a Font using AffineTransform?

Thanks.

A: 

From memory:

Font tallerFont = font.deriveFont(AffineTransform.getScaleInstance(1.0, 2.0));
Sii
+1  A: 

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.

Michael Myers