Here is a small example that show what seems to be a bug:

import pyglet
document = pyglet.text.document.FormattedDocument('A')
document.set_style(0, 1, dict(bold=True))
layout = pyglet.text.layout.IncrementalTextLayout(document,100,100)
document.delete_text(0,1)


Nicolas


On Mar 13, 3:22 pm, Nicolas Rougier <[email protected]> wrote:
> Hello,
>
> How can I set the default font of a FormattedDocument when it is
> empty ?
>
> For UnformattedDocument I can use
> document.set_style(0,0, {'font_name': 'some_font'}
>
> But for FormattedDocument, I cannot do the same.
>
> One trick could be to wait for some text to be inserted and then set
> the font_name but as soon as the text becomes empty pyglet crashes
> (for example, in the text_input.py example, replaces the
> UnformattedDocument with a Formatted one and specify a font in the
> attributes).
>
> Any idea ?
>
> Nicolas
--~--~---------~--~----~------------~-------~--~----~
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