Thanks. However it gets a little more complicated than that. I use the LineBreakMeasurer. By using the transform on the FontRenderContext, the LBM knows how big the text will be and will break the line appropriately. I suppose I could spoof the graphics context by applying a scale to it's bounds (and to the text wrapping width), then using LBM and applying the scale to the graphics right before the tl.draw() call as you indicate. Hmm, possible workaround.
Still, would be nice if the FontRenderContext.transform worked as before!
David
Kevin Weiner wrote:
[EMAIL PROTECTED]">David Kavanagh wrote:Here is the problem:
FontRenderContext.transform not being applied in TextLayout.draw()
You can just apply the appropriate translate and scale transforms
to the graphics context instead. That works in all versions
(including 1.2, where TextLayout also has transform problems).
AffineTransform trans = AfineTransform.getScaleInstance(0.5,0.5);
tl = new TextLayout("Hello - with scale", fontAttrs,
new FontRenderContext(null, true, true));
Graphics2D g2 = (Graphics2D) g;
g2.translate(25, 200);
g2.transform(trans);
tl.draw(g2, 0, 0);
---------------------------------------------------------------------
Kevin Weiner FM Software 610-997-3930 http://www.fmsware.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
