Good point.  Actually, I think the correct solution is more
complicated than either of us is thinking.  Right now the delimiters
are allowed to be either the first or last character on a line,
depending on what fits the best.  This is clearly wrong since none of
these characters should ever be the first on a line unless you're
typing gibberish.  I've never programmed a word processor, but I think
the correct solution is this:

1.  A new line should be started after a line's last hyphen or before
its last whitespace.
2.  If no suitable place to break a line is found, just start new line
after the last character that fits on the line.
3.  Whitespace should be removed from the beginning of the new line.

Now I'll see if I can program this.
--
Terry Welsh  /  mogumbo 'at' gmail.com
www.reallyslick.com  /  www.mogumbo.com


> Message: 3
> Date: Fri, 19 Feb 2010 07:18:42 +0000
> From: Robert Osfield <[email protected]>
> To: OpenSceneGraph Users <[email protected]>
> Subject: Re: [osg-users] line wrap delimiters in osgText
> Message-ID:
>        <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Terry,
>
> On Fri, Feb 19, 2010 at 12:48 AM, Terry Welsh <[email protected]> wrote:
>> In Text.cpp and Text3D.cpp, the current list of delimiters used to
>> find the last character in a line is
>> SPACE \n / , ; : .
>>
>> I propose instead using
>> SPACE \n / -
>>
>> Everyone okay with this? ?As it is now you commonly see lines starting
>> with periods that should accompany the word on the previous line.
>
> I haven't looked at the code but my guess is that it is trying to
> include the comma and fullstop on the same line, note that is looking
> for the last character on a line, not the first character on the next
> line.  If it's failing then perhaps it's one off somewhere.
>
> Robert.
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to