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

Posts: 81
Registered: ‎06-24-2009
My Device: Not Specified

How do I set the default app font confidently?

[ Edited ]



I want to set a my app's default font to BBAlpha Sans, 20px height. Here is the code I use:



try {
            FontFamily fontFam = FontFamily.forName("BBAlpha Sans");
            Font font = fontFam.getFont(FontFamily.SCALABLE_FONT, 20).derive(Font.PLAIN);            
catch(Exception e) {} 



How confident can I be that BBAlpha Sans will always be present and not throw an exception?

If confidence is low, what is my best bet to get the closest available font?






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

Re: How do I set the default app font confidently?

getFontFamilies() allows you to check the available fonts in advance.

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