Re: Unexpected font rendering with pango



Kaixo!

On Fri, Jun 27, 2003 at 02:32:16PM +0100, Abigail Brady wrote:

> > Recently I have found an unusual behaviour in Chinese font rendering
> > with Pango.Please have a look at the attached, little screenshots. The
> > only difference between both is the setting of the locale before starting
> > the application. The first one uses LC_ALL=en_US and the second one
> > LC_ALL=zh_CN.GB2312. The font rendering is - despite the missing
> > antialiasing - fine on the second pix, but not o.k. in the first
> > case. It somehow uses a different size of fonts in just one string ...
> > 
> > Anyone out there who has an idea or a hint how to track this and/or to
> > fix this ?
> 
> It's doing this because of the preference order of the fonts.  With
> en_US its picking up a japanese or korean font first, and using that to
> display any characters it has support for - and only then moving to the
> chinese font.  When in the chinese locale, it knows to use chinese fonts
> first...  So you'll need to fiddle with the config files.

The problem is that it is using a *non scalable* font at a *wrong size*.
Imho pango (well, Xft actually I think) should first look at scalable fonts,
and only if no scalable fonts are found ressort to non scalable ones,
if that is already doable trough a config option, then I would be interested
to know what option it is, in order to enable that by default.

It is simply too bad that a single text get in mixed sizes, just because
the first matching font is used, without checking it has the character 
at the right size. Such an output is acceptable if the only other
alternative would be to display an empty square, but that is not the case
here.

Even worst: the first character of the paragraphe is a traditional chinese
one, and taken from a traditional chinese font; imho in such case 
pango should continue with the same font as long as possible, instead of
switching to the default one for the next (for every?) character (that
behaviour may not be wanted for latin/greek/cyrillic etc; but for CJK it
makes sense to stick when the same font as long as possible; that is,
if a given character was not on the default font, nor in the first CJK
font ('ja' or 'ko' covering one in this case), and was on another CJK font,
then it should stick with that one, as it is likely that other characters will
be in the same case. Following that ordering will give a much better
output in all cases of normal CJK text.

But if that is too complex to do, pango must at least give priority to
scalable fonts, having a word with some letters near 3 or 4 times the size
of some others is horrendous.

-- 
Ki ça vos våye bén,
Pablo Saratxaga

http://chanae.walon.org/pablo/		PGP Key available, key ID: 0xD9B85466
[you can write me in Walloon, Spanish, French, English, Italian or Portuguese]

Attachment: pgpbkZMlO5DGy.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]