Re: font anti-aliasing or smoothing



On Sat, Dec 11, 1999 at 10:23:14AM -0500, Havoc Pennington wrote:
> You need a function to return font metrics, or you need X to do the
> antialiasing itself using its own font metrics.

No. No. No.

Not my plan at all.

IMHO, font smoothing is much needed by X. X can't do it without
(major?) changes, so let's do it in the GDK!

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.

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.

-- 

	john fremlin vii
	http://altern.org/vii



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