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
mjnip
Posts: 27
Registered: ‎09-04-2008
My Device: Not Specified
Accepted Solution

ActiveRichTextField setFont to bold

How do you set an activerichtextfield to use a bold font?  I tried doing this and it doesn't work.  In the API it says setFont is inherited from RichTextField.

 

Font font_Bold=Font.getDefault().derive(Font.BOLD); ActiveRichTextField mo_Art_text = new ActiveRichTextField( "text" ); mo_Art_text.setFont(font_Bold);

 

 

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: ActiveRichTextField setFont to bold

ActiveRichTextField is much more complicated - it maintains arrays of fonts and and colors that align with regions (start and ending offsets) within the control.

 

I guess you can set up an array of one font and this will be assigned to the region at offset zero. See the API docs for RichTextField.

 

 

Please use plain text.
Developer
mjnip
Posts: 27
Registered: ‎09-04-2008
My Device: Not Specified

Re: ActiveRichTextField setFont to bold

Thanks RexDoug. It's all good now.
Please use plain text.