BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
ronaldg Offline
New Member
 
Posts: 12
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Default Font Problem - 10-29-2009, 03:43 PM

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
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
ronaldg Offline
New Member
 
Posts: 12
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Default Oops - 10-29-2009, 04:22 PM

Wrong forum sorry everyone
   
Reply With Quote
  (#3 (permalink)) Old
Dougsg38p Offline
CrackBerry Addict
 
Posts: 806
Join Date: Mar 2008
Location: Austin, TX
Model: 8320
PIN: N/A
Carrier: T-Mobile
Default 10-29-2009, 04:58 PM

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.
   
Reply With Quote
  (#4 (permalink)) Old
ronaldg Offline
New Member
 
Posts: 12
Join Date: Oct 2008
Model: 9000
PIN: N/A
Carrier: rogers
Default 10-30-2009, 07:27 AM

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
   
Reply With Quote
Reply


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-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.