I have a situation where users are editing a vector drawing in a program where the font doesn't match what I display in my renderer. In their editing program, all that is saved is a world "height" for the text, so I can use that to scale and match the font once I draw it.
Now, the font they use in the editing program is monospaced, so based on the height, i can calculate a "maximum width". Saying that, I'm trying to find a way to simply draw a string saying and make sure it doesn't exceed this bounding box (height and calculated width).
Is there any easy and fast way to do this?
What I have now tries to match the height, and it does, but then when it goes for the width it has to decrement the size until the width is not greater than the calculated width. There are some cases where this takes too many iterations and is slow.
So if anybody has any idea what I'm talking about :-), what's a good idea to just say, draw this string and don't exceed these bounds?
Thanks
Augusto
=========================================================================== 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".