Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Maybe the wrong question to ask? Re: [platform-swt-dev] FontMetrics question about width?

Since nobody rose to the siren call for an explanation of how to do what we can do in AWT, let me rephrase the question.

I want to draw an oval and put some text inside it. How to I, when given a String as a label inside the oval, know what bounding rectangle to assign to the oval? That is, the oval, or a rectangle, or any other shape, needs to know how large it should be based on the text (font, size, etc) that it will surround. Maybe FontMetrics is the wrong metaphor. What is the right metaphor?

Thanks
Jack

Steve Northover wrote:


Did I miss the discussion about fontMetrics.width()?




In taking some awt stuff -- really cool stuff worth moving to SWT -- I
am running into the fontMetrics.width() issue. Is there a graceful
workaround?

Thanks
Jack






Back to the top