freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Freetype2 & gamma correction


From: Artur Zaprzala
Subject: Re: [Devel] Freetype2 & gamma correction
Date: Sun, 30 Mar 2003 14:19:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Billy Biggs wrote:
Vincent Caron (address@hidden):


Then, you must also question the notion of 'coverage', since it
involves a kind of filtering on the pixel. AFAIK, FreeType smooth
rasterizer does a 'box filtering' (?).  I was wondering if it would be
hard to plug a 'filtering function' on the current rasterizer.
Obviously, you can ask FreeType to oversample NxN and then do your own
pixel coverage computation for each NxN block. Does anybody have tried
such an experiment ?


  Funny, I'm actually working on this 'experiment' right now. :)  I was
planning on doing it the cheap way and having freetype render to a large
bitmap, then sample that myself, but of course eventually I'll have to
do my own point sampler based on the glyph outline.  Unless of course
someone already has some glyph point sampling code, which would be
ideal. ;-)

  A main reason I want to do the point sampling method is that it will
make my hacked code for doing borders around glyphs alot easier, I can
do a cheap convolution by just drawing, say, a circle for every pixel in
the supersampled version, and then point sampling that.  Wouldn't be as
accurate as trying to enlarge the glyph curves directly and point
sampling that, but would be cheap in terms of time to code.

  Anyone else have any thoughts?


I've implemented OSD font renderer for MPlayer that draws borders around glyphs by convolving image with a circle and than doing a gaussian blur. I doubt supersampling will give much more quality. Since then I found a better (faster and higher quality) algorithm based on distance measurement with subpixel accuracy, assuming for siplicity that pixel coverage is equivalent to a distance, but hadn't time to clean it up for public release.

Another way is to use experimental stroker module from FreeType.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]