[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using contours for vectorized drawing
From: |
Pavel Kankovsky |
Subject: |
Re: Using contours for vectorized drawing |
Date: |
Sun, 19 Mar 2000 14:04:07 +0100 (MET) |
On Wed, 15 Mar 2000, Ang Bodhi wrote:
> I studied FT_Raster_Render() and found that
> FT_Decompose_Outline() is used to obtain the outline data in
> the form of a series of Move_To, Line_To, Conic_To, Cubic_To
> operations. In the last three ops, a line segment or a
> Bezier curve is intersected with each y scanline to obtain
> the x value. In this way, a glyph's intersection coordinates
> with a uniformly spaced grid is obtained for rasterization
You need to run FT_Outline_Decompose() (the function has been renamed
recently) with your own Conic_To and Cubic_To functions (supplied via
FT_Outline_Funcs *). Unlike the functions in ftraster.c that split given
curves until they get segments spanning a small number of horizontal
scanlines only, your functions would split curves into halves (see
Split_Conic and Splic_Cubic) until they get segments straight enough to
be approximated with lines, i.e. until the angles of a segment's bounding
triangle or quadrangle corresponding to its endpoints are small enough
(plus there should be some additional criterion for cubic curves with an
inflexion (i.e. S-shaped curves)).
Of course, keep in mind FT2 is still under construction when using it.
--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."