Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » platform-dependent font size issue
platform-dependent font size issue [message #450613] Wed, 16 February 2005 10:38 Go to next message
Eclipse UserFriend
Originally posted by: fane.classys.net

Hello.
In short, I have SWT fonts rendering correctly under Linux but not under
Windows, where they seem to ignore the specified size. Does anyone know
why this happens?
Re: platform-dependent font size issue [message #450647 is a reply to message #450613] Wed, 16 February 2005 14:12 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
You'll have to provide code before we can look at it.

"Mike Wazowski" <fane@classys.net> wrote in message
news:cuv7r5$gcb$1@www.eclipse.org...
> Hello.
> In short, I have SWT fonts rendering correctly under Linux but not under
> Windows, where they seem to ignore the specified size. Does anyone know
> why this happens?
Re: platform-dependent font size issue [message #450652 is a reply to message #450647] Wed, 16 February 2005 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fane.classys.net

I have a font size picker dialog, part of a large eclipse plugin; there
are a few Text widgets there, each showcasing the same sample text with
different font sizes, so that the user can pick one of those sizes.
Under Linux, the font of the text in each Text widget is of a different
size (which is correct) but under Windows all Text widgets always
contain text of the exact same size.

I do something like:


// displayBox is a org.eclipse.swt.widgets.Text
// font is a a org.eclipse.swt.graphics.Font.
// someContainer is a map where I store fonts

Font font = someContainer.getFont();
displayBox.setFont(font);
displayBox.setText(displayString);

That's all. There is in no way any difference when running the
application, other than the operating system. Even if there was some
logical mistake in my code, shouldn't the visual result be the same
anyway? Thank you.


Steve Northover wrote:
> You'll have to provide code before we can look at it.
>
> "Mike Wazowski" <fane@classys.net> wrote in message
> news:cuv7r5$gcb$1@www.eclipse.org...
>
>>Hello.
>>In short, I have SWT fonts rendering correctly under Linux but not under
>>Windows, where they seem to ignore the specified size. Does anyone know
>>why this happens?
>
>
>
Re: platform-dependent font size issue [message #450847 is a reply to message #450652] Fri, 18 February 2005 15:18 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Are you setting the font on the parent or on each text control?

"Mike Wazowski" <fane@classys.net> wrote in message
news:cuvq2a$ala$1@www.eclipse.org...
>
> I have a font size picker dialog, part of a large eclipse plugin; there
> are a few Text widgets there, each showcasing the same sample text with
> different font sizes, so that the user can pick one of those sizes.
> Under Linux, the font of the text in each Text widget is of a different
> size (which is correct) but under Windows all Text widgets always
> contain text of the exact same size.
>
> I do something like:
>
>
> // displayBox is a org.eclipse.swt.widgets.Text
> // font is a a org.eclipse.swt.graphics.Font.
> // someContainer is a map where I store fonts
>
> Font font = someContainer.getFont();
> displayBox.setFont(font);
> displayBox.setText(displayString);
>
> That's all. There is in no way any difference when running the
> application, other than the operating system. Even if there was some
> logical mistake in my code, shouldn't the visual result be the same
> anyway? Thank you.
>
>
> Steve Northover wrote:
> > You'll have to provide code before we can look at it.
> >
> > "Mike Wazowski" <fane@classys.net> wrote in message
> > news:cuv7r5$gcb$1@www.eclipse.org...
> >
> >>Hello.
> >>In short, I have SWT fonts rendering correctly under Linux but not under
> >>Windows, where they seem to ignore the specified size. Does anyone know
> >>why this happens?
> >
> >
> >
Previous Topic:Label.setImage() and Lable.setText()
Next Topic:Can you set components to be transparent/opaque?
Goto Forum:
  


Current Time: Thu Mar 28 08:46:42 GMT 2024

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

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

Back to the top