[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: word wrapping in KDE apps
From:       André Somers <a.t.somers () student ! utwente ! nl>
Date:       2003-11-08 0:19:05
[Download RAW message or body]

Hi,

>I would like to improve the word wrapping correctness and consistency
>across all of KDE. Right now, it seems many important apps have their
>own somewhat half-baked word wrapping solution. Two majorly visible
>parts, the khtml component and the katepart compoment both implement
>their own schemes for word wrapping (the latter simply breaks on a
>space, which is totally wrong for cjk, for example).
I think you have got a point, and it _would_ make sence to provide this 
functionality. 

>From looking at various word-wrapping code, it seems the function that
>is needed should look like:
>
>int findBreakPoint(QString& str, int col)
>
>and
>
>int findBreakPoint(QString& str, QFontMetrics& fm, int maxLineLength)
Wouldn't it be more efficient if you would be albe to pass an entire paragraph 
at one go, and have it broken into lines for you? I _think_ that could be 
implemented more efficiently than passing the paragraph in a QString, getting 
the int, splitting the QString into a line and passing the rest again, until 
the paragraph doesn't need to be broken again.

What would be _extremely_ cool I think if you could also use a decent 
hyphenation in conjunction with finding linebreaks. Wouldn't it be cool if 
you could make KHTML use hypenation on a webpage with a lot of text? :P~

8<
>Now, a quick look through Qt 3.2.2 shows that they actually have a
>pretty good implementation of the Unicode line breaking algorithm. The
>only problem is it is implemented in some private classes, which are not
>exposed through the API. 8<
>I am considering just pulling out the stuff one would need to make it
>available to KDE applications. 
I don't know what the policy is for Qt-copy wich is in the KDE CVS, but I 
guess the whole point of having it there is to be able to make adjustments 
like this...

disclaimer: don't take my word for it. I'm don't have anywhere near the karma 
needed to make significant desisions like this. 

André

-- 
My opinions may have changed, but not the fact that I am right.
-- Ashleigh Brilliant

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic