BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-29-2009, 03:43 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Font Problem

Please Login to Remove!

I am loading fonts and I can't seem to scale them

net.rim.device.api.ui.Font font10 = fontFamily.getFont(FontFamily.TRUE_TYPE_FONT,10,Ui .UNITS_pm);
net.rim.device.api.ui.Font font12 = fontFamily.getFont(FontFamily.TRUE_TYPE_FONT,12,Ui .UNITS_pm);
net.rim.device.api.ui.Font font14 = fontFamily.getFont(FontFamily.TRUE_TYPE_FONT,14,Ui .UNITS_pm);

If I use UNITS_px they are really small.

I then loop through loading them changing the font height up to 40

I do this on the emulator and it works.
I do this on the device and it crashes after 14
The font on the blackberry is 14 size only when I look at it in the actual screen setup.
BBAlpha San

Why would it work on the emulator and not on the device
Obviously the font size isnt' on he device but how come the UNITS_px when I specify 14 looks like half a mm tall

Really really small.
I have to actualy load 40 size in order to have it about 1/8inch tall

Thanks very much
Offline  
Old 10-29-2009, 04:22 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Oops

Wrong forum sorry everyone
Offline  
Old 10-29-2009, 04:58 PM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You need to request the font in points, rather than pixels.

Something like this:

m_listFont = m_defaultFont.derive(Font.BOLD,8,Ui.UNITS_pt)

These fonts will be scaled properly for the device.
Offline  
Old 10-30-2009, 07:27 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, Thanks very much for the reply. Problem solved.
I did what you said and then also change it from
FontFamily.TRUE_TYPE_FONT
to
FontFamily.CBTF_FONT
Both things solved the problem

I don't know what CBTF_FONT fonts are. I suppose it would be good to find out.
I couldn't seem to find much docs about them but I'm sure I looked in the wrong place.
Thanks again
Problem solved
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.