On Tue, Jan 31, 2012 at 1:26 AM, Proton <[email protected]> wrote: > Hi all, > > I'm currently writing a simple game, and used pyglet.text.layout, > but the 2 things below makes me crazy -> > :: layouts have an attribute called 'wrap', if true, layout will break > long lines from spaces, > if a single long word exceeds layout width, it won't snap but just > overflow. > This may not be a problem for English(or sth. similar) users, since > there's always spaces, > but for chinese it won't wrap at all. > I tried to insert ZWSP(Zero width space) character after chinese > chars, but they appear as > little boxes, not 'zero width' > > :: Is there any means to add attributed/html text to a document > incrementally? > pyglet.text.decode_attributed always return a new document, > if i want to append some more text, i have to > decode_attributed(the_whole_text + new_text), > and the speed is unacceptable. > currently i use a custom grammar to achieve the same effects.
Have you tried the latest version of pyglet from the repository? I looked at pyglet.text.layout in the repository, and it appears you can also pass 'char' as an argument to the wrap parameter, which will cause it to wrap at any character. ~ Nathan -- 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.
