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: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Changing the Font of the browser content

Hi Guys,I want to change the Font and its size of the elements of  browser content,but i am unsuccessful

 

It Shows always System Font,,how could it be changed.Besides it,in 6.0 i get the texts very large.

 

This is code that i tried using

 

 

content = session.getBrowserContent(new StringHttpSource(rss_item.getDetails()),DetailsScreen.this,0);
			final Field ff=content.getDisplayableContent();
                        ff.setFont(resr.SampleFont());
                        add(ff);

 

 

,How can the font be changed?

 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Changing the Font of the browser content

And here is the screenshot that i get in which Font size tooo large in 6.0,So Could be rectified?

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Changing the Font of the browser content

Still no idea why font size is so large,in 6.0.Any Ideas?

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Changing the Font of the browser content

No reply for this post.?

 

Question that i asked,ii found  this issue only with 6.0 OS.Because the code works well for rest of the OS version,

and still i am clueless why i can't reduce the font size,

 

 

Plz SomeGuys make respones

 

 

Regards

 

Rakesh Shankar.P

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

Re: Changing the Font of the browser content

Have you tried using css or similar mechanism in the pages you are displaying to set the font?

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Changing the Font of the browser content

Hi Peter.I tried using Bold font,but that not making much of difference,

 

this is code that i use

 

final BrowserContent content;
		try {
			
			RenderingSession session=RenderingSession.getNewInstance();
			RenderingOptions options=session.getRenderingOptions();
			options.setProperty(RenderingOptions.CORE_OPTIONS_GUID,RenderingOptions.SHOW_IMAGES_IN_HTML,true);
                        options.setProperty(RenderingOptions.CORE_OPTIONS_GUID,RenderingOptions.DEFAULT_FONT_SIZE,8);
                        
			//content = session.getBrowserContent(new StringHttpSource("<b>"+rss_item.getDetails()+"</b>"),NewsDetailsScreen.this,0);
                        content = session.getBrowserContent(new StringHttpSource(rss_item.getDetails()),NewsDetailsScreen.this,0);
                        
                        content.finishLoading();
			UiApplication.getUiApplication().invokeLater(new Runnable(){
				public void run(){
					add(content.getDisplayableContent());
				}
			});
			
		} catch (RenderingException e) {
			// TODO Auto-generated catch block
			System.out.println("Loading Error"+e.getMessage());
			header.setTitle("Error"+e.getMessage());
		}

 

 

In the code ,i just commented for bold font that i use.

 

 

Regards

 

Rakesh Shankar.P

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Changing the Font of the browser content

[ Edited ]

Did i make things,Clear to you.?,There is not much of difference in using bold font.

 

 

i tried at first using bold font("<b>"+rss_item.getDetails()+"</b>").

content = session.getBrowserContent(new StringHttpSource("<b>"+rss_item.getDetails()+"</b>"),NewsDetailsScreen.this,0);

and then i reomved it

content = session.getBrowserContent(new StringHttpSource(rss_item.getDetails()),NewsDetailsScreen.this,0);