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

List:       koffice
Subject:    Re: Implementing hyphenation / wordwrap for Thai
From:       Reginald Stadlbauer <reggie () troll ! no>
Date:       1999-09-12 12:32:32
[Download RAW message or body]

On Sun, 12 Sep 1999, Rudiger Koch wrote:
>What about to have a shared lib that contains the code to separate words and
>does the hyphenation/separation and to have the K-App to do something with the
>result. The lib could implement a static method separate():
>
>separate (char* sepstr,   // string to be separated
>               int pos,   // rightmost position for separation
>            char* lstr,   // left side of the separated String
>           char* rstr);   // right side of the separated String
>
>Example: Hyphenation of the German word "Neckar".
>
>sepstr = "Neckar";
>pos    = 3;   // no separation right of pos 3 (the "k")
>
>separate(sepstr, pos, lstr, rstr);
>
>// Now lstr == "Nek-"
>// and rstr == "kar"
>
>The K-App now has to check if "Nek-" fits into the line and if not call
>separate() again with a smaller value of pos
>
>This allows separate() to implement all kinds rules that are in languages,
>it frees to authors of the language specific separate() functions from
>knowing details about internals of K-Applications. 
>
>The lib might also have a user interface to configure some parameters in
>separate().

I think this is much too slow for KWord. As I said, I'll have to think about
that a bit more. It has to be done a bit more optimized. And BTW: char* is dead
dead dead :-) Always use QString! And for KWord it has to work with KWString
else muich too much conversation is needed which results in slowness. As I said
it wil be possible to use the same code for all edit widgets which use QString,
but KWord will need its own stuff as this has to work directly with KWStrings.

--
Reggie

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

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