 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Hodgins Guest
|
Posted: Sun Feb 20, 2005 3:14 pm Post subject: Text3D Dimensions |
|
|
Hi,
Is it possible to get an accurate width and height of Text3D objects?
I have already tried using:
String myStr = "hello world!!!";
Font font = new Font("Arial", Font.PLAIN, 2);
FontRenderContext rc =
simpleU.getCanvas().getGraphics2D().getFontRenderContext();
LineMetrics lm = font.getLineMetrics(myStr, rc);
double fontWidth = font.getStringBounds(myStr, rc).getWidth();
double fontHeight = font.getStringBounds(myStr, rc).getHeight();
I check the results by drawing a line box around the Text3D object
using the height and width obtained above and the results are not bad
but not good enough.
Chris
|
|
| Back to top |
|
 |
Martin Hedler Guest
|
Posted: Tue Mar 15, 2005 8:03 pm Post subject: Re: Text3D Dimensions |
|
|
| Quote: | Hi,
Is it possible to get an accurate width and height of Text3D objects?
I have already tried using:
|
I think Text3D has a getBounds methode.
Martin
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|