[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## RE: Converting Outlines to postscript Vector

**From**: |
Just van Rossum |

**Subject**: |
RE: Converting Outlines to postscript Vector |

**Date**: |
Tue, 29 Feb 2000 11:15:53 +0100 |

At 9:07 AM +0000 29-02-2000, Satpal Chander wrote:
>*> I'm not 100% sure, but it seems FT1.x doesn't have the decompose outline*
>*> API like FT2 has, so I guess you'll have to walk trhough the*
>*> outline object yourself.*
>
>*If this is the case then how stable is the FT2 stuff considering that I'm*
>*only interested in the outline data for each glyph.*
I can't answer that. Still: just iterating over the outline yourself is
hardly harder than using the FT_Outline_Decompose() function in FT2.
>*> Even so, it should be fairly straightforward, though:*
>*>*
>*> - There are on-curve and off-curve points in TT (and therefore in FT1.x)*
>*> - Between any two consecutive off-curve points there is an*
>*> implied on-curve*
>*> point (exactly in the middle between them).*
>*> - A quadratic segment (onCurve, offCurve, onCurve) can be converted to*
>*> cubic beziers (as used by PS) like so:*
>*> let (from, control, to) be the three points making up de*
>*> quadratic curve*
>*> you need to convert these three points to four points for*
>*> cubics: (from,*
>*> control1, control2, to)*
>*> control1 = from + (control - from) * 2.0/3.0*
>*> control2 = to + (control - to) * 2.0/3.0*
>*> from and to remain the same.*
>
>*Does the algorithm above meant that I don't have to actually*
>*do anything with the curves using the curve maths, just manipulating the*
>*control points and outputting them to postscript. ;-))*
That's correct. TT's quadratic curves can be converted to PS's cubic
beziers with the above algorithm without any loss of quality. (The reverse
is *not* possible without losing information.)
Just