I have some Java code that is essentially, as follows:
AffineTransform _1 = AffineTransform(getScaledInstance(1.2, 1.1);
Font f1 = (new Font("Dialog", Font.BOLD, 12)).deriveFont(_1);
...
if (...)
f1 = f1.deriveFont(AffineTransform.getRotateInstance(Math.toRadian(90));
...
setFont(f1)
All works well when the if condition is false, the font is scaled appropriately. However when the if condition is true while the font rotation occurs correctly the size appears to be the base 12pt font, it is *not* scaled. It as if the method deriveFont() does not actually create a new transformed font but merely sets a property of the font object and the transformation occurs when the font is used. Thus when deriveFont() is invoked for the second time that property is changed and the initial transformation is lost.
If you have any insight as to how best dela with this situation it would be greatly apperciated if you would let me know.
AffineTransform _1 = AffineTransform(getScaledInstance(1.2, 1.1);
Font f1 = (new Font("Dialog", Font.BOLD, 12)).deriveFont(_1);
...
if (...)
f1 = f1.deriveFont(AffineTransform.getRotateInstance(Math.toRadian(90));
...
setFont(f1)
All works well when the if condition is false, the font is scaled appropriately. However when the if condition is true while the font rotation occurs correctly the size appears to be the base 12pt font, it is *not* scaled. It as if the method deriveFont() does not actually create a new transformed font but merely sets a property of the font object and the transformation occurs when the font is used. Thus when deriveFont() is invoked for the second time that property is changed and the initial transformation is lost.
If you have any insight as to how best dela with this situation it would be greatly apperciated if you would let me know.