[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: |
Mon, 28 Feb 2000 18:21:52 +0100 |
At 4:59 PM +0000 28-02-2000, Satpal Chander wrote:
>Hi,
> Has anyone tried doing the above from the outline structure as returned
>buy
>TT_Load_Glyph().
>I have found a page
>http://www.icce.rug.nl/erikjan/bluefuzz/beziers/beziers/beziers.html
>It does give a good definition there of howto do it but I'm new to fonts/
>beziers /postscript and the like.
>Can anyone tell me if I can/should get at the curve data directly of through
>the
>api, I'm using 1.3.1.
>Also if the cruve data split into segements or is it just one long curve.
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. 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.
Hope this helps,
Just