Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » change font for all widgets in an application
change font for all widgets in an application [message #460631] Thu, 01 September 2005 22:37 Go to next message
Eclipse UserFriend
Originally posted by: gilbert.pilz.sbc-guesstherest.net

I'm using SWT 3.1 on WinXP. For whatever reason the default font seems
to be Courier-10. I would like all of the widgets in my application to
have a different font than this. Right now I can't see a better way of
doing this than to call setFont() on every single widget that I create.
This is a bit of a PITA and I was wondering if there was a way to change
the default font at a global level?

- g
Re: change font for all widgets in an application [message #460752 is a reply to message #460631] Tue, 06 September 2005 18:26 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
There isn't a way to globally change this, because created widgets take on
the default font that is specified by the OS (which ultimately was supplied
by the user). In general a user's specified OS font/colour preferences
should be respected by all apps; beyond preferred aestetics, this can also
be important for low-vision users that use unusually large fonts or
contrasting colours.

Grant

"Gilbert Pilz" <gilbert.pilz@sbc-guesstherest.net> wrote in message
news:df7vsf$nau$1@news.eclipse.org...
> I'm using SWT 3.1 on WinXP. For whatever reason the default font seems
> to be Courier-10. I would like all of the widgets in my application to
> have a different font than this. Right now I can't see a better way of
> doing this than to call setFont() on every single widget that I create.
> This is a bit of a PITA and I was wondering if there was a way to change
> the default font at a global level?
>
> - g
Re: change font for all widgets in an application [message #460799 is a reply to message #460752] Wed, 07 September 2005 10:41 Go to previous messageGo to next message
Ricky is currently offline RickyFriend
Messages: 204
Registered: July 2009
Senior Member
I found FormToolkit a few moments ago and it is a step in the right
direction. It is more like a static factory as a real toolkit but adding a
widget cache to it should make it usable. At least color and font should
be globally changable this way. To make styles dynamicly changeable is
harder. The toolkit could return proxy objects which delegates all method
calls to a real widget. The widget may be disposed and reinstantiated
later with a new style and references to it are not broken as the proxy is
in between.

> In general a user's specified OS font/colour preferences
> should be respected by all apps

IMHO toolkit developers should not restrict common operations like setting
general UI delegates to enforce some (domain specific) guidelines. I am in
the situation where my management decided to use RCP because it is hip and
trandy while having the requirement to have an exchangeable corporate
identity. This is quite hard with SWT and JFace as everything is
hardcoded. Its nice to have native widgets but it is unacceptable to not
have the possibility to alter UI delegates if you have to.

I dont want to be rude but this uninspired simplicity and lack of real
control over objects gives me a hard time to accomplish my tasks. Or I
havent looked hard enough for a solution...

Ricky
Re: change font for all widgets in an application [message #460803 is a reply to message #460799] Wed, 07 September 2005 11:01 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
This is the same problem with most web pages. They assume that 'everyone wants to see stuff in 10pt font' and hard-code it in CSS (or, if they're really old, HTML). When it's viewed on a large (or high-res) monitor, the fonts can shrink down to unintelligible sizes.

So Eclipse is pulling out the OS stuff, and as such, looks like every other application on your system. If you want to change what Eclipse looks like, change the look and feel of your system.
Re: change font for all widgets in an application [message #460805 is a reply to message #460803] Wed, 07 September 2005 11:50 Go to previous message
Ricky is currently offline RickyFriend
Messages: 204
Registered: July 2009
Senior Member
> This is the same problem with most web pages. They assume that 'everyone
> wants to see stuff in 10pt font' and hard-code it in CSS (or, if they're
> really old, HTML). When it's viewed on a large (or high-res) monitor,
> the fonts can shrink down to unintelligible sizes.

The same is true for SWT with the implicit assumption that every developer
wants its app look native. I totally agree that hardcoding is the wrong
way as the context may (will!) change and everything is messed up then.
But in contrast to SWT a web page does not forbit to do it your way.

> So Eclipse is pulling out the OS stuff, and as such, looks like every
> other application on your system. If you want to change what Eclipse
> looks like, change the look and feel of your system.

I am not religious about all this, I rather see it pragmaticly and in the
light of my current task. The computer science is money driven like no
other science and so the word of a manager is more worth than of a simple
developer. The manager says buttons should look orange so what do I do? In
general, as a programmer, I want to have control over my application to
fullfill my wishes and the dope induced visions of my product manager.
SetBackground is insufficiant as the hole area is colored and the round
corners arent taken into account. And changing the system defaults is not
acceptable neither by usability standards nor conceptional as there sould
be other ways to paint your walls than detonating a color bucket in your
room. I really only look for a way to get my task done and SWT isnt
helping here.

So, I stop complaining now.

Ricky
Previous Topic:Where's the color editor from Preferences?
Next Topic:Draw with GC on Canvas and redraw the canvas
Goto Forum:
  


Current Time: Wed Jun 26 14:26:02 GMT 2019

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

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

Back to the top