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
Posts: 33
Registered: ‎06-12-2009
My Device: Not Specified

BrowserField in 6.0+ has minimum font size?

I'm running into a strange problem using the BrowserField in an application I'm building. It seems that anything with a fontsize less 17px gets rendered as 17px. This doesn't happen in any of the web browsers, only in the embedded BrowserField.

 

Has anyone else encountered this? Found a solution?

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: BrowserField in 6.0+ has minimum font size?

Developer
Posts: 33
Registered: ‎06-12-2009
My Device: Not Specified

Re: BrowserField in 6.0+ has minimum font size?

Thanks for the reply maadani.

 

Have you been able to get that working? I've tried to implement the code, but it doesn't seem to be doing anything.

 

Using a 9780 running 6.0.0.285

 

My code is:

 

int fontSize = 1;
browser_field.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.MINIMUM_FONT_SIZE, Integer.toString(fontSize));

 

Developer
Posts: 33
Registered: ‎06-12-2009
My Device: Not Specified

Re: BrowserField in 6.0+ has minimum font size?

[ Edited ]

Managed to get this working. I think the Integer.toString was part of my problem.

 

Not sure if all of this is needed, but it works.

 

int fontSize = 4;
browser_field.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, 
RenderingOptions.MINIMUM_FONT_SIZE, fontSize);
browser_field.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.MINIMUM_FONT_SIZE_DEFAULT, fontSize);
RenderingSession renderingSession = RenderingSession.getNewInstance();
renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.MINIMUM_FONT_SIZE, fontSize);
renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.MINIMUM_FONT_SIZE_DEFAULT, fontSize);