02-20-2013 03:00 PM
I'm adding localisation code to my current project and need to implement more complex fonts such as Chinese and Japanese. The code extracts standard font characters from a png sheet to display with OpenGL. If the characters do not exist in the sheet it needs to fall back to using system fonts.
I have the localised text stored in Utf8 format but need pointing in the right direction as to how to write characters from the Chinese system font (for example) to an OpenGL texture.
Any help would be much appreciated.
02-21-2013 05:04 PM
All European characters are stored in a PNG file. It is the Chinese/Korean/Japanese characters that aren't stored - I have the Uincode or Utf8 for the localised Asian strings and want to render the system fonts that are already available in the BB10 device to OpenGL textures.
I guess what I need to know are the names of the system fonts used to display those languages and also a method of writing characters from those fonts onto textures.
Looking in bbutil, bbutil_load_font loads the first 128 characters from fonts which clearly doesn't cater for unicode fonts. I'm wondering if my best solution would be to adapt bbutil_load_font so that I can pass in a unicode string and it will use a map, rather than an array, to add characters that are needed and haven't already been loaded (and, likewise, adapt bbutil_render_text so that it receives a unicode string and uses the map to render the correct loaded characters).
So, I *think* what I need to know are the names of the system fonts used to display Chinese, Japanese and Korean, and also whether the method I've proposed is the easiest/best way of writing characters from those fonts to OpenGL textures.
02-22-2013 08:40 AM
Yes, I understand that. What I am trying to say is I doubt System Fonts (i.e. Fonts used by BB10 OS) are available to us thus fonts you see int the folder are for users and I doubt any of them contain Chinese characters. So if you have your own fonts (bitmaps) then they can be easily loaded/used if you don't then I don't think we have access to fonts used by BB10 OS -(
I do hope that I am wrong but... -(
02-22-2013 09:29 AM
Ah, I see. It's the way the project has worked on iOS and Android so I (optimistically) assumed a similar method would be possible with BB10 devices. As nobody else has interjected to say otherwise then it looks like I'll have to provide my own Chinese/Japanese/Korean fonts. Definitely not something I really want to do. Ah well, such is life - thanks for your replies