[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: FontMetrics missing some usefull functions...

You could enter a bugzilla feature request for
FontMetric.getLargestCharWidth().
In the meantime, you can use GC.textExtent() to measure a character.  'W' is
ususally
the widest English character.

"Hans Deragon" <hans@xxxxxxxxxxx> wrote in message
news:b8680o$7as$1@xxxxxxxxxxxxxxxx
> Greetings.
>
>
>    I need to figure out how long my Text field should be to contain 10
characters.
>
>    Using FontMetric.getAverageCharWidth() is not good enough.  I do not
want
> the average, I want the size of the largest (usually 'm').
>
>    Is there some other way I can get the information I am looking for?  I
want
> to get the largest character width, and it would also be nice if I could
get
> the width of a particular character.
>
>    FontMetric.getLargestCharWidth()
>    FontMetric.getCharWidth(char character)
>
>    Maybe I should open a feature request for this.
>
>
> Sincerely,
> Hans Deragon
> --
> Deragon Informatique inc.             Open source:
> http://www.deragon.biz                http://swtmvcwrapper.sourceforge.net
> mailto://hans@xxxxxxxxxxx             http://autopoweroff.sourceforge.net
>
>
>
>
>