Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Can a Font have a height of zero?
Can a Font have a height of zero? [message #447073] Wed, 08 December 2004 14:19 Go to next message
Charlie Surface is currently offline Charlie SurfaceFriend
Messages: 40
Registered: July 2009
Member
On SWT for Win32, it is valid to create a Font with zero height (new
Font("Courier",0,0)). The strange thing is that the resulting Font can
be set on a Label, and is large enough to read. It is also large enough
to be read when drawn by a GC.

Can I expect similar behavior on all SWT platforms? If so, can someone
explain a good reason for them? If a developer needs to find the
smallest available font, can't they just use Device.getFontList()?

thanks,
Charlie
Re: Can a Font have a height of zero? [message #447103 is a reply to message #447073] Wed, 08 December 2004 15:49 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Font creation never fails (I forget which platform forced this behavior ...
was it Motif?). Anyways, if you pass garbage to a Font constructor, you
will get the closest match for the platform.

"Charlie Surface" <charlie_surface@yahoo.com> wrote in message
news:cp72gt$9pr$1@www.eclipse.org...
> On SWT for Win32, it is valid to create a Font with zero height (new
> Font("Courier",0,0)). The strange thing is that the resulting Font can
> be set on a Label, and is large enough to read. It is also large enough
> to be read when drawn by a GC.
>
> Can I expect similar behavior on all SWT platforms? If so, can someone
> explain a good reason for them? If a developer needs to find the
> smallest available font, can't they just use Device.getFontList()?
>
> thanks,
> Charlie
Previous Topic:WinXP-style echochar for passwords
Next Topic:no swt-mozilla-gtk-3063 in java.library.path??
Goto Forum:
  


Current Time: Wed Oct 21 07:18:59 GMT 2020

Powered by FUDForum. Page generated in 0.05472 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top