> I'm working on code to implement rendering of fonts on a GPU. In
> reality, the fonts will be rendered on the CPU using FreeType2 and a
> texture representing the shape will be sent to the GPU as in the
> paper at alice.loria.fr/publications/papers/2005/VTM/vtm.pdf.
Interesting.
> To do that I need certain information at each pixel. Namely:
>
> 1) Where at the top or left side of the pixel, does the first
> discontinuity occur (If there is more than one discontinuity it will
> increase the resolution until there is only one.)
I'm not completely sure how a `discontinuity' is defined (I've only
quickly skimmed the abovementioned article), but I believe that this
information is not available. The smooth rasterizer only computes
vertical or horizontal spans, that is, it searches for intersections
of the grid with the outlines. If I interpret the article currectly,
this is not sufficient information for you.
> 2) At that point, what is the angle to the tangent of the
> discontinuity.
Ditto.
> 3) Likewise for the bottom or right side of the pixel.
Ditto.
> My plan is to modify the 'grays' raster to generate this data and
> send it to the 'call-back' function where I will create the
> necessary texture for the GPU.
This shouldn't be too hard, I believe, especially if the subdividing
of the Bézier curves as done in the smooth rasterizer satisfies your
needs.
> My assumptions are that the ftgrays AA rasterer is the best choice
> because it has the most data points. (Though the texture map I will
> generate stores only black/white; the GPU will calculate the
> gray/opacity level from the above data.)
In case it doesn't suffice you could use FT_Outline_Decompose,
providing proper callbacks to handle the lines and Bézier arcs by
yourself.
Werner
_______________________________________________
Freetype-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype-devel