On Wed, Oct 8, 2008 at 8:39 PM, xyloidhead <[EMAIL PROTECTED]> wrote:
>
> Thanks for the info Alex.
>
> I'll look at the source and see if it looks obvious to me. I'm
> doubtful of my ability to spend to much time on it and may end up just
> re-creating the functionality in my own class.
>
> I'm happy for any suggestions about the classes I should concentrate
> on

The module docstring in pyglet/text/document.py describes the internal
representation used by pyglet.text.FormattedDocument (which is what
you'll be wanting to add a 'save()' method to).

I remember documenting the attributed markup format at some time, but
can't seem to locate it now!  The decoder
(pyglet/text/formats/attributed.py) is quite small but a little
opaque.  If you can decode its regex you should understand it just
fine :-)

Essentially you just need to iterate over the runlists in the
document, extract the start and end of each run, then write them out
in order, interleaved with the document text.  Some care is needed to
escape characters and handle whitespace appropriately (so that it's
read in the same way by the decoder).

Alex.

--~--~---------~--~----~------------~-------~--~----~
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