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

List:       koffice-devel
Subject:    Re: Kword: Big problems with fonts
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-01-13 12:21:40
[Download RAW message or body]

On Saturday 12 January 2002 21:23, Pavel Troller wrote:
> Hi!
>   One of modules which I'm polling with a big importance is koffice.

koffice@kde.org is a better list for discussing about koffice BTW ;-)

>   I see that many features are being added, but there are now some basic
> problems, which render its components unusable.

I'm not adding any feature until I get those font problems fixed (they are all 
due to the introduction of WYSIWYG since 1.1)

>   For example, in kword, I have a very big problems with fonts.
>   Whenever I open a document (kword native or imported), I see the text
> just like dots. The font is so small that there are no letters visible.
> Just dots.
>   I can select an area of the text using mouse and then change the font.
>   Changing the size doesn't help.
>   What helps, is changing the font itself. The text becomes immediately
> visible.
>   What I have discovered, is the following:
>   Almost all nont-ttf (bitmap) fonts render extremely small (as dots only).
Right - Thomas Zander found that out long ago, and we talked about it on the 
koffice lists a bit.

>   Some ttf fonts are rendered perfectly (Arial, Impact)

Yes.
See, WYSIWYG means being able to use the same font metrics at all zoom levels 
(and when printing), proportionnally (font twice as big at 200% than at 100% 
etc.). What we do is to use a high resolution internally (equivalent to a 
2000% zoom), and to calculate the metrics for a given zoom level 
proportionnally from there.
But unscaled bitmap fonts don't support being zoomed to 2000% - the "unscaled"
parameter in XF86Config (or xfs's config, or XftConfig I guess) means that 
those fonts will NOT accept being used as very big fonts, the size will not 
be proportionnal.

Now, about solutions:
- we talked about excluding such fonts from KOffice
- I just had another idea: for such fonts we could use the metrics at 100% as 
reference, instead of the metrics at 2000% - i.e. getting the metrics at 100% 
and then multiplying them by 20. At least at 100% and other reasonable zoom 
levels (e.g. up to 500% maybe, if the bitmap font accepts being zoomed up to 
that), we'd have something acceptable.

Now, the problem with all solutions is: finding out that this the font is 
"unscaled". IIRC Thomas Zander was thinking about using 
QFont::isFixedPitch(), but this seems to be only about fixed fonts, not about
all unscaled bitmap fonts (am I right that it's not the same thing ? Selecting 
a fixed font in konsole shows very few available "fixed" fonts, whereas 
bitmap fonts are much common than that, AFAIK).

This is where we might need some help from Qt - a way to know what kind of 
font it is.
Another way is to detect that the font is unscaled because "size at 1500% == 
size at 2000%" ... this might break with some fonts (and some font sizes) 
though....

>   Other ttf fonts are rendered with correct size, but the text is overtyped
> (Comic Sans), but it appears only on some documents, imported from msword.
> When the font is changed, overtyping disappears, but when it is returned,
> it appears again. When this font is used for writing in kword, it gives
> correct results.
Not sure what's happening here - test document welcome.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david, http://www.konqueror.org
KDE 3.0: Konquering the Desktops

_______________________________________________
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