Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Developer
bcq
Posts: 34
Registered: 11-02-2009

Special font styles

Hi all,


Does anyone know how to implement the display of special text formats ( subscript, superscript, italic subscript, etc.) on list field?



Thanks and best regards.

Please use plain text.
Developer
erinliisa
Posts: 17
Registered: 11-02-2009

Re: Special font styles

 

import net.rim.device.api.ui*;
...
Font f = this.getFont(); [Your listField].setFont(f.derive(Font.ITALIC, f.getHeight(), Ui.UNITS_px));

The above will use the current screen's font but in italics.  You could specify other styles or sizes.

Check out the API for the OS version you are developing for and look up the Font class.  It has all the info to setup a new font.

 

The 4.5 API is here: http://www.blackberry.com/developers/docs/4.5.0api/index.html for example.

 

 

Please use plain text.
Developer
Developer
bcq
Posts: 34
Registered: 11-02-2009

Re: Special font styles

[ Edited ]

Thank erinliisa, but follow your solution i just can use font style for specify field on list. (i think) 

 

I mean if there are special characters (superscript, subscript etc.) in random field on my list, then it will be displayed exactly.

 

Anyway, thank you again.

 

My writing skill is really really bad :smileytongue:

Please use plain text.
Developer
erinliisa
Posts: 17
Registered: 11-02-2009

Re: Special font styles

If you are referring to a listfield or a keywordlistfield and you want to have different styles of font within one list element, I would suggest overriding the listfield's drawListRow() method and drawing the text where you want it in the style you want.

Please use plain text.
Developer
Developer
bcq
Posts: 34
Registered: 11-02-2009

Re: Special font styles

some1 plz help

Please use plain text.