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

List:       koffice-devel
Subject:    Re: underlining etc.
From:       Tomasz Grobelny <grotk () poczta ! onet ! pl>
Date:       2003-01-17 0:25:34
[Download RAW message or body]

On czw 16. stycznia 2003 20:12, David Faure wrote:
> On Thursday 16 January 2003 19:57, Tomasz Grobelny wrote:
> > > Which forces to go for a "difference in line widths when different font
> > > sizes are used together" instead of the "calculating an average"
> > > solution (does any other word processor really do it that way?).
> >
> > I don't know. But it was you who said that I should look at other WPs
> > (idea, not implementation).
>
> Yes - and the result is? :)
> (see below)
>
> > > Thanks for reverting KoTextStringChar to its original size, this is
> > > very important.
> >
> > Would 4 bytes for interger be acceptable?
>
> No, sorry. Wasting 4 bytes per char only for the very rare case of
> different underline widths is not worth it. Do you realize how much memory
> it eats? You get 33% more memory being used. In the document 1dfre10.txt
> found by jon-d, with 1600000 characters, you'd get a memory usage - just
> for the characters - of 32MB instead of 25MB !
>
It would be 25% (16->20 bytes) to be precise. BTW couldn't x be "short int" 
instead of "int"?

> Think about all those non-underlined chars...
So alone without a line under them... Horrible!

> This is exactly why everything else (concerning characters) is in
> KoTextFormat.
>
But this property is a bit diffrent: user can't change it, it can't be saved 
to/read from file and it is not that dependent on what a user sets. It is all 
about _calculating_ and drawing.

> Ok, I tested in OpenOffice and
> 1) the width (and distance) of the underline is indeed the same for the a
> set of underlined characters next to each other (but can be different
> within a paragraph, of course). 2) it's not averaged, it's max()ed. This
> means the biggest font size wins, which makes sense.
>
Do you mean that underline width depends only on the biggest font? In case of 
OpenOffice 1.0 that's not true. It is average (of some kind).

> This is easy to implement, in fact. The width is the _same_ for all the
> underlined characters. So there's no need to store it in the characters.
> Simply store it in all the kotextformats that are part of a "set of
> underlined characters". This means that this property must be added to
> kotextformat, must be part of its key, and the textformatter must set it,
> to the biggest width for a given set of underlined characters.
It is the same for all characters in one group. But can be diffrent for 
characters of the same formatting that are placed in diffrent lines. And 
AFAIR KoTextFormat object is shared between characters of the same formatting 
so we can't separate this easily. If ulw was a property of KoTextFormat it 
could force creating KoTextFormat objects on line break, and that's not the 
right way IMHO.

Tomek


***************r-e-k-l-a-m-a**************

Chcesz oszczedzic na kosztach obslugi bankowej ?
mBIZNES - konto dla firm
http://epieniadze.onet.pl/mbiznes
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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