Unicode Font

Do anyone know how to display Unicode Font in OpenGL on Windows NT? All examples I found are only displaying ASCII.

Please help me. Thank you a lot.

If you are using wglUseFontBitmaps or wglUseFontOutlines, isn’t it just a simple issue of giving the range of characters to use from a given font? And then using GL_UNSIGNED_SHORT as the type of data in the string when glCallLists is called? I think that’s all that would be necessarily different.

Originally posted by DFrey:
If you are using wglUseFontBitmaps or wglUseFontOutlines, isn’t it just a simple issue of giving the range of characters to use from a given font? And then using GL_UNSIGNED_SHORT as the type of data in the string when glCallLists is called? I think that’s all that would be necessarily different.

Nope… you have to remember that if you try to generate a full unicode font set, for starters, you’ll be generating 65,535 display lists. I don’t know if video cards even handle that many.

Another thing is that the font must have all of the Unicode glyphs in it. Most do not I don’t think.

And finally, you have to write the glPrintf-style function in order to handle the mapping into the Unicode character set. And THIS in particular is no small task (though mapping into the ASCII portion of Unicode is the same as mapping into straight ASCII).

Trust me, OpenGL does NOT support Unicode via the wgl* functions. If it does, the app that I’m working on would have had the German and Japanese versions localized before the English version was finished.

The only way I can think of to support Unicode at all is to generate a bitmap-set, basically autogenerate or do it by hand, in order to do billboarding. I think that this will be the ONLY way to support Unicode in OpenGL properly.

I haven’t tryied it though.

Good luck! And if you find out something I don’t know, let me know. I still have a localization problem of my own.

Siwko

Can’t you do it the other way around? I mean, build the display lists explicitly for the given string rather than the whole set? Then use glCallLists with the Unicodes converted into call list indices? And as far as the font supporting Unicode, I would take it as a given that it does if you are going to be using Unicode (at least the subset you are using). If no font is available that supports Unicode, then you’d have to come with some other solution obviously.

[This message has been edited by DFrey (edited 02-13-2001).]

Originally posted by DFrey:
[b]Can’t you do it the other way around? I mean, build the display lists explicitly for the given string rather than the whole set? Then use glCallLists with the Unicodes converted into call list indices? And as far as the font supporting Unicode, I would take it as a given that it does if you are going to be using Unicode (at least the subset you are using). If no font is available that supports Unicode, then you’d have to come with some other solution obviously.

[This message has been edited by DFrey (edited 02-13-2001).][/b]

Thats a clever idea, but the process of building display lists is VERY time consuming. Especially if your strings are going to be large and/or have many of them. I really don’t think it would be very effective in that case. (I’ve had display lists build over 100x slower than a single draw)

Thank you very much. :slight_smile:
I can finish my work now.
I think I will use wglUseFontBitmapsW() directly. And write a font manager for speed.

I dunno about anyone else, but I have found the method of using the wglFont routines with glCallLists to be extremely sloooww, at least compared to using a prerendered bitmap texture and then drawing my characters as a textured quad using the font texture, like by an order of magnitude. Maybe I was doing something wrong, but I don’t think so. I’m just surprised people use it at all, I guess

The textured quad is clearly faster. But is expensive to use when you need to support Unicode which may involve tens of thousands of characters, some of which may not have even been assigned a code at the time the program was written. Using something like wglUseFontOutlines makes that quite a bit easier to deal with.

[This message has been edited by DFrey (edited 02-13-2001).]

It would be really handly to know the best way to construct a display list using only the characters in a string, rather than loading all the characters in a set. Do you have any idea how it could be done?

Matthew