Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
11-22-2012 03:19 PM
Since the simulator returns 0 if you ask for the screen dpi using :
dpi = bbutil_calculate_dpi(screen_cxt);
what dpi should be specified for testing?
I have tried setting it to 170, but my text seems very small when I compare to the same code running on the PB OS 2.1
Solved! Go to Solution.
11-22-2012 03:44 PM
11-22-2012 05:16 PM
Thanks. That is what I'm after.
However, I found a problem with the dpi value in my code and fixed it.
If I use dpi=170 with the simulator, the text looks reasonable.
If I use dpi=356, the text appears too small.
Not having a device in hand, I can't check it.
Would it be safe to assume that the simulator is based on 170dpi, while the device will actually be 356 (or 358 as posted by another developer), and that if I just used the value returned by bbutil_calculate_dpi(screen_cxt); , the text will appear OK on the device?
11-22-2012 05:25 PM
11-22-2012 05:36 PM
Loading the font with
bbutil_load_font( "/usr/fonts/font_repository/monotype/arialbd.ttf", 48, dpi);
is dependent on the dpi.
I.e. I believe that bbutil_load_font is scaling the requested size (48 here) based on the dpi of the screen so that, for example, if a font size was used that was 1/2 the screen height, it would always appear 1/2 screen height on a 170dpi screen or a 356dpi screen.
bbutil_render_text does not include a font size parameter, since this is determined by bbutil_load_font