How to change the default font of my RCP application? [message #500698] |
Fri, 27 November 2009 15:00 |
Marton Sigmond Messages: 73 Registered: July 2009 Location: Hungary |
Member |
|
|
Hi,
I would like the whole RCP application use a specific font.
So without calling the setFont() method for every control in the whole app, I would like to set it globally, like setting a default font.
Is it possible?
Thank you for your help.
Marton
Best Regards,
Marton Sigmond
Senior Software Engineer
|
|
|
|
|
|
|
Re: How to change the default font of my RCP application? [message #501433 is a reply to message #501418] |
Wed, 02 December 2009 10:09 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Forgot to mention. There's another solution to this which also provides
declarative styleing for (SWT, Swing, Qt, ...).
The project is named UFaceKit [1] comes with it's own very tiny
Declarative Styling Syntax (compared to the big dependency stack of
e4-0.9 styling).
The bad thing is that UFaceKit has no build yet (we've been blocked by
bringing all dependencies to orbit) you can consume out of the box so
you need to checkout the sources from SVN.
Since 1 week all dependencies for the SWT-Port of UFace are in orbit and
we started working on a Buckminster build
Talking of UFaceKit it provides other probably interesting features like:
* Declarative Styling (including automatic resource management for
colors, fonts, images)
* MVP Development model
* Java5-Viewers with type safety
* XPath-Query to walk your UI-Widget-Tree
* JSON-Serialization (Handy for JUnit-Tests)
* Events on programmatic property setting
* Reflective API similar to EMF
* Declarative UI-Definition using EMF
* ...
Tom
[1]http://wiki.eclipse.org/UFaceKit
Tom Schindl schrieb:
> SWT uses the System-Font like you specified it your
> OS-Theme-Configuration. In plain 3.x there's not other possibility than
> to call setFont() on all the labels.
>
> The future (e4) though will solve this by letting you use a declartive
> Syntax (similar to CSS) the this would look like this:
>
> my.css
> ------
> Label {
> font-family: Comic Sans;
> }
>
> The nice thing is that the e4-css engine coming with e4 0.9 can be run
> on 3.5-SWT-Code without problems.
>
> The best thing to find out how it works is to check out the CSS-Example
> part of the e4-CVS
> (dev.eclipse.org:/cvsroot/eclipse/e4/org.eclipse.e4/examples /org.eclipse.e4.ui.examples.css.rcp).
>
> Tom
>
> Marton Sigmond schrieb:
>> Hi Wim,
>>
>> thank you for the answer.
>>
>> The first approach cannot be taken, since this is an RCP application
>> that does not have preferences menu.
>>
>> Themes:
>> Many fonts can be overridden, but not the default font.
>>
>> So for example when I create an instance of the
>> org.eclipse.swt.widgets.Label, it uses some font.
>> What is the font that the Label uses?
>> How can I set it globally (without calling the setFont method for each
>> label)?
>>
>> And of course not just the Label I am interested in, but every widget.
>> Can I set a font that every widget uses by default?
>>
>> Thanks,
>> Marton
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03456 seconds