On Tue, 1 Apr 2008, dave berk wrote:
> I'm trying to display some non-english text within the opengl window. I
> pre'd the text with u, but it doesn't seem to help. All I get is question
> marks. What should I do to display utf-8 encoded text? is it even
> supported?

pyglet's text rendering will accept a unicode string for rendering just fine. 
In some instances your selected font may not support certain glyphs so you'll 
see a placeholder glyph instead.

Try this:

 import pyglet
 t = pyglet.text.Label(u'\u20ac')
 w = pyglet.window.Window()
 @w.event
 def on_draw():
    t.draw()
 pyglet.app.run()

It should render a Euro symbol in the bottom-left of the window.


    Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to