[Issue N32570] [Qt 3.2.x Regression] Text wrap madness

qt-bugs at trolltech.com qt-bugs at trolltech.com
Tue Oct 14 12:44:47 BST 2003


Hi Marc,

On Tuesday, 07. Oct 2003 23:45 Marc Mutz wrote:
> Hi!
>
> See http://bugs.kde.org/show_bug.cgi?id=63766
>
> Someone decided it might be cool to break lines not only at
> whitespace,
> but also at (certain?) non-alnum characters. You know, I could
> _potentially_ understand wrapping lines after hyphens. But that looks
> fishy already, since hyphens at the end of the line typically are
> hyphenations, but here, they're not.
>
> But what happened to me yesterday is _so_ mad that I do think this is
> a bug in the implementation or simply a feature that went berzerk.
>
> Consider: foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
> C+
> + foo foo foo foo
>
> What I did was to type "Consider: C++ foo foo foo foo", then went back
> to just after the colon and added foo's until the C++ would be pushed
> in the next line. But guess what? It's wrapped _inside_ the word!

The thing that happened was that we thought about following a
recommendation of the Unicode consortium (see
http://www.unicode.org/reports/tr14/). It tries to make a line breaking
algorithm that is general purpose and works well for most languages.
IMO they failed in this goal (but it was not until after the 3.2
release that I realized this).

The algorithm however is a lot better than what we had for non latin
languages, so the code is not as mad as you might think. I think I
fixed more or less all of the issues with latin text now (see attached
diff against 3.2.2).

> I can reproduce it using examples/textedit in the same way as above,
> so it's not a bug in KMail.
>
> Please make this feature available through a separate enum value for
> WrapPolicy and restore the Qt 3.1 behaviour of wrapping at whitespace
> characters only for AtWordBoundary (or de-deprecate AtWhitespace)

That's not the correct way to go, as this makes things work quite badly
for asian languages. The correct way is to fix the issues with latin
text as the patch does. Hope this is satisfying for you as well.

Lars

--
Lars Knoll, Senior Software Engineer
Trolltech AS, Waldemar Thranes gt. 98, N-0175 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3760 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031014/1b7611cd/attachment.diff>


More information about the kde-core-devel mailing list