Unicode text?
I was wondering if anyone has experience rendering Unicode text in OpenGL on OS X/Carbon. I tried a simple test using aglUseFont and found that it only works for ASCII (the first 256 glyphs just repeat for count > 256). So no luck thereĆ
Freetype and ftgl look impressive but I was hoping someone had actually used it for Unicode? Or is there another way?
Thanks!
Freetype and ftgl look impressive but I was hoping someone had actually used it for Unicode? Or is there another way?
Thanks!
I have to say, a rather interesting question. I never actually thought of it.
I assume the hard way would be to render Cocoa glyphs to a texture, and then convert that for OpenGL usability.
No idea what the easy way could be.
For sure, you needed a different access mechanism than simply calling an OpenGL display list.
Dunno what the case could be with creating outline fonts in GL. This gets a spot on my ToDo list.
I assume the hard way would be to render Cocoa glyphs to a texture, and then convert that for OpenGL usability.
No idea what the easy way could be.
For sure, you needed a different access mechanism than simply calling an OpenGL display list.
Dunno what the case could be with creating outline fonts in GL. This gets a spot on my ToDo list.
I can confirm that FTGL will let you draw unicode text very easily.
It's also not difficult to roll your own text-drawing stuff using FreeType directly.
Apple has sample code showing how to render an NSTextView to a texture. This gives you nice Cocoa text including all the kerning, ligatures and antialiasing.
It's not difficult to use CoreGraphics to render a string to a texture, but that only takes MacRoman and only does a single line if you do things the easy way... the hard way involves using ATSUI, which is pretty complex. I haven't tried this one
It's also not difficult to roll your own text-drawing stuff using FreeType directly.
Apple has sample code showing how to render an NSTextView to a texture. This gives you nice Cocoa text including all the kerning, ligatures and antialiasing.
It's not difficult to use CoreGraphics to render a string to a texture, but that only takes MacRoman and only does a single line if you do things the easy way... the hard way involves using ATSUI, which is pretty complex. I haven't tried this one
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Another way to display Unicode text | thanh thuy | 0 | 1,766 |
Feb 16, 2006 07:24 PM Last Post: thanh thuy |
|

