Thanks for the precise explanation, I will look into that and post
code when ready.

Nicolas


On Mar 23, 9:09 pm, Alex Holkner <[email protected]> wrote:
> In that case, you'd need to modify pyglet/text/layout.py's
> TextLayout._flow_glyphs_wrap to create a separate box for each word
> (currently boxes are as large as possible to accommodate a single
> style run on one line).  Then, after the line is committed but before
> the vertex list is created, respace the boxes so that the fill the
> available width instead of being adjacent.
>
> You would probably also want to remove space characters entirely and
> replace them with some flexible space that compresses a little smaller
> than the default width.
>
> If you follow this method, there shouldn't be any problem with
> selection/caret code finding the correct insertion point, and with
> IncrementalTextLayout invalidating at the right time.
>
> Alex.
>
> On Tue, Mar 24, 2009 at 6:34 AM, Nicolas Rougier
>
> <[email protected]> wrote:
>
> > Well, I was more thinking about the horrible way without hyphenation
> > and extra-stuff. Just having a fairly simple adjustment of spaces
> > between already wrapped words.
>
> > Nicolas
>
> > On Mar 23, 8:24 pm, Alex Holkner <[email protected]> wrote:
> >> On Tue, Mar 24, 2009 at 5:57 AM, Nicolas Rougier
>
> >> <[email protected]> wrote:
>
> >> > Hello,
>
> >> > I've a question concerning TextLayout and word wrap mode, would that
> >> > be possible (easy ?) to implement justification (i.e. adjust space
> >> > between wrapped-word such that all lines are equal in width ?)
>
> >> If you're willing to hack pyglet source, it would be a pretty simple
> >> thing to do this in the naive way (e.g., like a web browser).  But
> >> fully justified text done like this usually looks quite horrible --
> >> proper typesetting, including hyphenation, is a much harder problem,
> >> and the algorithms in use today aren't real-time, and often need human
> >> intervention.
>
> >> 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