Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Getting default fonts from the OS
Getting default fonts from the OS [message #509220] Thu, 21 January 2010 17:16 Go to next message
Norbert Schulz is currently offline Norbert SchulzFriend
Messages: 1
Registered: January 2010
Junior Member
I need to get a Font reference to the OS default fixed width font.
I tried to use

JFacePreferences.getPreferenceStore().getDefaultString (JFaceResources.TEXT_FONT)


This seems to always return the following 10.0 size font, independent of what I specified by the GNOME X11 OS environment.
1|Monospace|10.0|0|GTK|1|;

Is there a different API for getting the OS default fonts?

Thanks,
Norbert
Re: Getting default fonts from the OS [message #509483 is a reply to message #509220] Fri, 22 January 2010 15:05 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi Norbert,

The only API for getting the system default font is Display.getSystemFont().

If you're looking for a more specific system font (eg.- the font of items in
a List), then you need to create an instance of the Control, gets its font,
then immediately dispose the Control.

Grant


"Norbert Schulz" <schulz.norbert@gmail.com> wrote in message
news:hja24k$k6b$1@build.eclipse.org...
> I need to get a Font reference to the OS default fixed width font.
> I tried to use
>
> JFacePreferences.getPreferenceStore().getDefaultString
(JFaceResources.TEXT_FONT)
>
> This seems to always return the following 10.0 size font, independent of
what I specified by the GNOME X11 OS environment.
> 1|Monospace|10.0|0|GTK|1|;
> Is there a different API for getting the OS default fonts?
>
> Thanks,
> Norbert
>
Previous Topic:64 distro for eclipse.
Next Topic:[Mac] Refreshing window does not work well after resize or maximize
Goto Forum:
  


Current Time: Mon Nov 24 15:22:34 GMT 2014

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

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