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  <
============================================================================

----- Original Message -----
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".

Reply via email to