chaning fonts *only* w/ Synth  
Author Message
William Z.





PostPosted: 2005-8-16 23:50:00 Top

java-programmer, chaning fonts *only* w/ Synth Hey all,

I want the same interface appearance I have now, which is the Metal
LaF, but I just want to make the fonts different. Same style, smaller
fonts. I installed Synth and have the following XML defined ...

<synth>
<style id="default">
<font name="Helvetica" size="10"/>
</style>
<bind style="default" type="region" key=".*"/>
</synth>

If I understand this correctly, doesn't this make the font size
Helvetica 10 (globally using .*) as default, and the rest of the LaF
should stay the same style, right?

The problem is, this makes the default fonts correct all over my
application, but the rest of the GUI is completely ... styleless. Is
there anyway for my menus, buttons, etc... to stay as is using the
Metal LaF, yet change *only* the font size?

Any help much appreciated.

 
Vova Reznik





PostPosted: 2005-8-17 0:05:00 Top

java-programmer >> chaning fonts *only* w/ Synth William Z. wrote:
> Hey all,
>
> I want the same interface appearance I have now, which is the Metal
> LaF, but I just want to make the fonts different. Same style, smaller
> fonts. I installed Synth and have the following XML defined ...
>
> <synth>
> <style id="default">
> <font name="Helvetica" size="10"/>
> </style>
> <bind style="default" type="region" key=".*"/>
> </synth>
>
> If I understand this correctly, doesn't this make the font size
> Helvetica 10 (globally using .*) as default, and the rest of the LaF
> should stay the same style, right?
>
> The problem is, this makes the default fonts correct all over my
> application, but the rest of the GUI is completely ... styleless. Is
> there anyway for my menus, buttons, etc... to stay as is using the
> Metal LaF, yet change *only* the font size?
>
> Any help much appreciated.
>

Check out UIManager get(Object) and put(Object, Object) methods
For example for JButton it is
UIManager.put("Button.font", new FontUIResource(String, int, int));

And don't forget to update UI by calling
SwingUtilities.updateComponentTreeUI(Component);