Re: font anti-aliasing or smoothing



john fremlin vii <vii@altern.org> writes:
> IMHO, font smoothing is much needed by X. X can't do it without
> (major?) changes, so let's do it in the GDK!
>

They're working on it for a future X...
 
> As far as I see it there are two major ways in which this can be
> accomplished:
> 
> 1) Do it properly. Have GTK fonts which could have nothing to do with
> the ones X uses and anti-alias them properly. The freetype
> library, for example, could be used to do the actual work.
> 
> A lot of infrastructure modification, and the end-user has the
> administrative hassle of getting the fonts and configuring the
> system. Then again, it produces best possible results.
> 

Requires you to drop all the X drawing routines for a client-side
rendering model like GnomeCanvas. Major speed penalty, quite hard to
implement. But under consideration for a long-term GTK I think.

> 2) Hack it up. XDrawText on a buffer, say, with a font size 8x larger
> than wanted and then scale down to the desired size, in effect
> blurring the outlines of the fonts. Use this as the transparency mask
> (called alpha channel?) to draw the font. AFAICT, we have to grab the
> target window area into an XImage or somesuch, do the blending
> ourselves and then draw the resultant area back.
> 
> With a little bit of cunning this method can be used to smooth
> (smudge) even bitmap fonts.
> 
> This is an adequate solution I guess, though I have no idea whether it
> will be fast enough or produce reasonable quality. The GIMP does it
> this way, AFAIK.
> 

Results aren't very nice, it's slow, and it uses lots of RAM. Plus
it's just smoothing, not alpha blended antialiasing. Not to mention
the extreme badness of the hack. ;-)

Havoc



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