03-20-2011 04:34 PM - edited 03-20-2011 04:35 PM
I'm trying to port my application to BlackBerry, but I'm having difficulty with fonts. The application mixes a number of different languages together in the same UI, for example, a list of languages written in the particular language, but only one language per field. A number of languages appear as black filled boxes, which I understand from other posts that this means that the font doesn't exist on the device for those characters.
I could supply the fonts (presumably by packaging them with my app, then loading with FontManager.load()), but since I have a large number of languages, they would violate the 60 KB limit described in the API.
I apologize for the open ended question, but what is my best approach? Is this even possible? If not, is there a base set of languages that can be displayed on all devices?
For now, I'm okay restricting myself to API 6, but ideally, I would like to support devices back to API 5.
Solved! Go to Solution.
03-20-2011 05:58 PM
This might help when testing.
If you have a different font per Field, then each font has the 60 or 90 KB limits.
Also, I have found that the Blackberry will do what I think is a clever thing. If you have loaded a System font, and the character is not defined in the Font that is used for Field, the BB will actually search the System fonts looking for one that contains this character. So you might find the only characters you have to put in the special font are the characters that are missing from the standard fonts.
03-20-2011 10:26 PM
Thanks for the replies.
Peter, you have a good point that I can split the fonts into multiple files - my problem was that some fonts were too large. My solution has been to manually edit the font files (using FontForge) to remove characters and get the font file under the 60 KB limit.
I've since found font-optimizer which promised to be a more automated way to remove characters. I only hope that I can get logographic scripts such as Japanese and Chinese sufficiently reduced.
You mentioned a 90 KB limit. I didn't see mention of a 90 KB limit in the SDK, so I'm wondering if you know when this larger limit might apply?
03-21-2011 05:33 AM - edited 03-21-2011 12:07 PM
"when this larger limit might apply?"
If you look at the doc, there are two methods of loading a Font, by name and as a Stream. If you load as a Stream the font size is restricted to 90K. By name - 60 K. Which surprises me because if you put the font in your Application, you can convert it to a Stream using this:
I missed this originally as well and someone pointed this put to me! See here:
Edit corrected link.