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
Visitor
Posts: 1
Registered: ‎05-10-2012
My Device: Curve 8520
My Carrier: Blackberry

Reducing space between text lines.

Hi Fellas,

I am developing an application which shows content in multiple languages, for that I am using custom font files.

The issue at hand is that when I render the text inside a Richtext field, there is a huge gap between two lines. I see two approaches to handle this situation

1) Adjust some changes in the font file e.g. reduce the typo-ascender and typo-descender. (This helps to an extent).

Though this is not a recommended approach and I get stuck after a certain limit.

 

2) Look up if there is some API provided by BB to specify the line gap or similar properties.

 

I am seeking help from this communitiy to suggest useful APIs, tweaks. Please elaborate your answer as I am new to the font business.

 

Thanks in Advance

Brij

Developer
Posts: 17,011
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Reducing space between text lines.

welcome to the support forums.

this is not my area of expertise, maybe you can adjust it by using the derive method in the Font class
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/Font.html
----------------------------------------------------------
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
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Reducing space between text lines.

Not an area of expertise for me either....

 

You said "using custom font files".  I have always assumed that Fields like RichTextField will space out the text based on the height that they get from the Font.  So if the attributes of the font you are using have a height value that is too large, then this would explain what you see.  So perhaps you could look at the creation of your customer font?

 

Have you tried the same font in a PC application, like a Word document.  Is the spacing the same there too?