Hi Michele,
take a look at this JavaOne presentation by the Java2D team members.
I think you'll find exactly what you need:
"Advanced Java 2D API Topics for Desktop Applications: TS-3214, 2005"
http://developers.sun.com/learning/javaoneonline/2005/desktop/TS-3214.pdf
http://developers.sun.com/learning/javaoneonline/2005/desktop/TS-3214.html
Thanks,
Dmitri
On Mon, Oct 24, 2005 at 03:05:14PM +0200, Michele Puccini wrote:
> Thanks all for the hints.
>
> while stringWidth() is not for me (I want to get te maximum w,h of the
> glyphs in a font), g2d.getFontMetrics().xxx() sounds promising. I'll do
> further checks and let you know.
>
> Mik
> ============================================================================
> >ClassX Development Italy Via Francesca, 368/I I-56030 S.M. a Monte (PI) <
> >Tel.(+39)-0587-705153 Fax.(+39)-0587-705153 WEB: http://www.classx.it <
> ============================================================================
>
> From: "Bill Dodson" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, October 21, 2005 8:48 PM
> Subject: Re: [JAVA2D] java2d Glyph questions
>
>
> >I am not the person to give a definitive answer, but have you tried the
> >FontMetrics class? I get the total width and height of a string with
> >the following code:
> >
> > int sw = g2d.getFontMetrics().stringWidth(text);
> > int sh = g2d.getFontMetrics().getHeight();
> >
> >I notice there is also a getMaxCharBounds in this class. It uses a
> >Graphics context instead of FontRenderContext.
> >
> >Hope this helps.
> >bill
> >
>
> ===========================================================================
> 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".
===========================================================================
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".