08-01-2012 06:30 AM
This reference is already been checked. I think font is installed. When I display english characters, font converts them to hindi, but it is not able to display hindi/unicode characters in hindi.
08-01-2012 06:37 AM
08-09-2012 04:52 AM
I know, but it does document how I would expect this to work. Thought it might help.
The trick here is that a text string must be a Unicode representation of Hindi and the font must convert the associated Hindi Unicode characters to glyphs. of course it also has to be a TrueType Font and it has to match the Blackberry size requirements.
In my experience, the font only needs to cover the Hindi characters, and the BlackBerry will use it if it doesn't find a match for the characters in any other font. You could have the Font cover the Hindi and the other characters your application wants to use, but I don't think it has too.
There is a potentially related problem if you are using SQL for the data. In some earlier OS levels, the SQL Unicode characters get converted to Latin-1 when you ask for the String. So it looks like the characters are not being displayed correctly. In fact the characters are not correct from SQL.
Anyway, this is an area that I think should work, happy to try to help get it working.
Do you have a Hindi TTF font?
08-09-2012 05:01 AM
First of all thanks for the details.
I have used many hindi font files subject to size of 60 kb but none of them worked yet.
Data is coming from server, we are not using sql. Server is sending unicode representation of hindi characters, and we have to print these unicode characters in hindi in our fields.
The font files are printing english text to hindi, but they are not printing unicode characters to their respective hindi characters.
Thanks and Regards,
08-09-2012 05:23 AM
"Data is coming from server"
Data sent from the Server and not converted correctly is another surce of errors that look like font errors. The data should be sent as UTF-8 and you must convert the bytes corrrectly,. If you do
String textString = new String(<bytes>);
This will not work correctly, you need to include the "UITF-8" encoding as follows:
String textString = new String(<bytes>, "UTF-8");
Can you check your code to make sure you are doing this correctly?
If this all looks OK, then I would like to take a look. .
Can you please attach a Hindi TTF font and some Unicode Hindi characters - which you want to display. If you could give me these characters as Java code like the following
String hindiText = "\u....\u....";
where the \u is the Undocde fro the hindo characters.
08-09-2012 08:28 AM - edited 08-09-2012 08:40 AM
OP has supplied me with a test string and a set of fonts to try. Here is the answer.
I have not actually tried any of the fonts supplied becuase I beleive they will all fail.
I downloaded FontForge from here:
and used it to display the mapping used by the Fonts.
All the fonts supplied do not use the Unicode character set. Instead they replace the standard Latin characters with other glyphs. The could be used to display Hindi, but woud require tranlation of the Hindi character to the Latin character that is then displayed corectly using the Fonts. I would not recommend this approach.
You need to have a real TrueType Font that includes the Hindi characters in the corerct place. As an example, there is one avialable for download here:
The font above is too big to be used in BlackBerry, but perhaps you can edit it use FontForge (I would remove the non Hindi characters).
In short, the problem here is the Font. If you have a correct Font you should be able to display Hindi characters in OS 5.0.
Looking at this link:
I see there is reference to fonts available here:
I have attached the file downloaded, repackaged in a zip file since this forum does not seem to like tar files. It seems to contain 4 valid TTF fonts with the correct Unicode mappings which are small enough to be used on BlackBerry. I believe this is available under the GPL license, but please confirm this and make sure you are approriately licensed before using these fonts. At the very least, these might be useful for testing.
08-09-2012 09:00 AM
I presume that you are going to test what I have said.
I have NOT tested Hindi, I have just demonstrated to my satisfaction why the fonts you have tried previously do not work.
I would try the fonts supplied and see if, using them, you can get something working. Please come back to us on this Thread with the answer.