Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
knight9
Posts: 84
Registered: ‎09-21-2008
My Device: Not Specified

Font.setDefaultFont(Font ..) acting kind of stupid

So I want to control the font of my application and RIM provides us with the handy Font.setDefaultFont(Font ..) which is supposed to to exactly what I want. However, the Menus with in the application draw completely messed up.  The currently highlighted menu item draws in the System specified font which as you can see is quite a bit larger than the font I would like to be using in my app. 

 

Is there a way for me to override the focus font as well as the unfocus font. With ugliness like this, it will require that I run through my entire application and set the font on every field which is no only tedious but hard to maintain and error prone. Any suggestions are greatly appreciated.

 

Menu snipped

 

 

Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Font.setDefaultFont(Font ..) acting kind of stupid

I understand that the look and feel of menu's were controlled by the Theme, so I'm surprised that setting the default Font for the application had any effect on them.  Sorry that doesn't help much.....
Developer
jonberry
Posts: 484
Registered: ‎07-17-2008
My Device: Not Specified

Re: Font.setDefaultFont(Font ..) acting kind of stupid

It's a bug.
Developer
adwiv
Posts: 304
Registered: ‎08-01-2008
My Device: Not Specified

Re: Font.setDefaultFont(Font ..) acting kind of stupid

Never had this issue, but then I never tried chaning the font of the entire application.

 

Instead. I use setFont() on the screens or Fields of interest, and it works without any issues.

BlackBerry Development Advisor
MSohm
Posts: 14,864
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Font.setDefaultFont(Font ..) acting kind of stupid

This is an issue that has been fixed in newer releases.  It affected early versions of BlackBerry handheld software version 4.6.1 and all realeases of 4.6.0.  It is fixed in 4.7.0.  The work around is to change the font at the screen level instead of the application level.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
sheepk
Posts: 30
Registered: ‎06-01-2009
My Device: 9000 Bold

Re: Font.setDefaultFont(Font ..) acting kind of stupid

Does that mean we should put "Font.setDefaultFont(....)" in the constructor of every screen class?

 

This doesn't work for me, the menu is still completly messed up :smileysad:

Developer
simon_hain
Posts: 16,364
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Font.setDefaultFont(Font ..) acting kind of stupid

setFont is a method of the screen class (passed on from Field)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
sheepk
Posts: 30
Registered: ‎06-01-2009
My Device: 9000 Bold

Re: Font.setDefaultFont(Font ..) acting kind of stupid

OK!

 

I put it in a class which all my screens inherit, and it works, the menu is finally looking good :smileyhappy:.

 

Thanks. 

Developer
simon_hain
Posts: 16,364
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Font.setDefaultFont(Font ..) acting kind of stupid

you are welcome. please mark the thread as solved.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
sheepk
Posts: 30
Registered: ‎06-01-2009
My Device: 9000 Bold

Re: Font.setDefaultFont(Font ..) acting kind of stupid

I'd like to, but I'm not the author of the thread, so I cant' do it.