Unicode text?

elb
Unregistered
 
Post: #1
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!
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
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 Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Another way to display Unicode text thanh thuy 0 2,020 Feb 16, 2006 07:24 PM
Last Post: thanh thuy