On 4/3/08, Drew Smathers <[EMAIL PROTECTED]> wrote:
> Looks like a bug to me.  I've attached a patch that should fix this.
>
>  -Drew
>
>
>  On Wed, Apr 2, 2008 at 1:11 PM, Nathan <[EMAIL PROTECTED]> wrote:
>  >
>  >  Maybe I'm just not understanding the message from the assert statement
>  >  below, but Text seems to have broken when you're passing in 'width'.
>  >
>  >  See example code below.
>  >
>  >  ~ Nathan
>  >
>  >
>  >  Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
>  >  [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
>  >  Type "help", "copyright", "credits" or "license" for more information.
>  >
>  >  >>> import pyglet
>  >
>  >  >>> log_font = pyglet.font.load('Monaco',12,dpi=72)
>  >
>  >  >>> curr_text = pyglet.font.Text(log_font, "User has authenticated.",
>  >  color=(1,1,1,1), x=3, y=5, halign='left', valign='bottom', width=700)
>  >
>  >  Traceback (most recent call last):
>  >   File "<stdin>", line 1, in <module>
>  >   File "/Library/Python/2.5/site-packages/pyglet/font/__init__.py",
>  >  line 346, in __init__
>  >     group=self._group)
>  >   File "/Library/Python/2.5/site-packages/pyglet/text/layout.py", line
>  >  718, in __init__
>  >     assert not multiline or width, 'Must specify width with multiline'
>  >  AssertionError: Must specify width with multiline
>  >
>  >  >
>  >
>
>
>
>  --
>
> \\\\\/\"/\\\\\\\\\\\
>  \\\\/ // //\/\\\\\\\
>  \\\/ \\// /\ \/\\\\
>  \\/ /\/ / /\/ /\ \\\
>  \/ / /\/ /\ /\\\ \\
>  / /\\\ /\\\ \\\\\/\
>  \/\\\\\/\\\\\/\\\\\\
>   d.p.s
>
>
>  >
>
> Index: pyglet/font/__init__.py
>  ===================================================================
>  --- pyglet/font/__init__.py     (revision 1990)
>  +++ pyglet/font/__init__.py     (working copy)
>  @@ -340,9 +340,10 @@
>
>          self._group = _TextZGroup()
>          self._document = pyglet.text.decode_text(text)
>  -        self._layout = pyglet.text.layout.TextLayout(self._document,
>  +        self._layout = pyglet.text.layout.TextLayout(self._document,
>                                                multiline=multiline,
>                                                dpi=font.dpi,
>  +                                              width=width,
>                                                group=self._group)
>
>          self._layout.begin_update()
>
>

Thanks, patched in r1991.

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