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

List:       koffice-devel
Subject:    Re: underlining etc.
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2003-01-16 19:12:43
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 !

Think about all those non-underlined chars...
This is exactly why everything else (concerning characters) is in KoTextFormat.

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.

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.

- -- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Klarälvdalens Datakonsult AB, Platform-independent software solutions
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2.1 is available - http://download.kde.org/stable/koffice-1.2.1/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+JwQr72KcVAmwbhARAoEqAJ4oK9vTn7P70sPdiRhHA6tMbBiBLACgsSfI
YHcWO0TK192O7Qop79nig0Y=
=R4jp
-----END PGP SIGNATURE-----

_______________________________________________
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