Re: [ft] Getting Vectors from a TTF font

2009-01-12 Thread Werner LEMBERG
> So, if i've understand everything, the tags of each point will help
> me to know if the point is on the outline,

Yes.

> and if not, to solve the
> Bezier's equation that will permit me to find points on the curve

No need to solve it at all.  Just bisect the curves (you can look up
this property in the internet) until you get an approximation which
can be substituted with a straight line.


Werner


___
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Getting Vectors from a TTF font

2009-01-12 Thread Frederic Kwiatkowski
> > In fact I use FT_Vector structure to approximate each char i want to
> > display in a short number of points. Then using these points to
> > display a simplified version of my char.
>
> This doesn't work in general.
Ok


> > But sometimes, points extract from the FT_Vector seems to be
> > erronous (ie some points are really out of the outline).
>
> Of course not!  Before discussing this further, please read
>
>  http://freetype.freedesktop.org/freetype2/docs/glyphs/glyphs-6.html
>
> so that you understand how outline points are stored.
So, if i've understand everything, the tags of each point will help me
to know if the point is on the outline, and if not, to solve the
Bezier's equation that will permit me to find points on the curve


Thanks for all, i'll try to find how make my char drawing finest


___
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Getting Vectors from a TTF font

2009-01-12 Thread Werner LEMBERG
> In fact I use FT_Vector structure to approximate each char i want to
> display in a short number of points. Then using these points to
> display a simplified version of my char.

This doesn't work in general.

> But sometimes, points extract from the FT_Vector seems to be
> erronous (ie some points are really out of the outline).

Of course not!  Before discussing this further, please read

  http://freetype.freedesktop.org/freetype2/docs/glyphs/glyphs-6.html

so that you understand how outline points are stored.


Werner


___
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Getting Vectors from a TTF font

2009-01-12 Thread Frederic Kwiatkowski
In fact I use FT_Vector structure to approximate each char i want to display
in a short number of points. Then using these points to display a simplified
version of my char.

But sometimes, points extract from the FT_Vector seems to be erronous (ie
some points are really out of the outline).
I could use Bézier cuvre but the processor that run Freetype is about an
hundred Mhz so i thought that working with FT_Vector would use less CPU that
using Bézier curves.

So to summarise, it's better to use the Bezier curve and next to extract
points by myself than using the FT_Vector structure?
In this case, why this structure is available via the ouline found in the
FT_GlyphSlot structure?


On Mon, Jan 12, 2009 at 11:37 AM, Werner LEMBERG  wrote:

>
> > I'm currently trying to extract vectors from TTF fonts with freetype
> > (via outline.points[].x or outline.points[].y).  But the problem is
> > that sometimes, those vectors give me ugly chars.  Is there any
> > possibilty to extract more vectors from the TTF (to increase
> > resolution) or must i use bitmap and get vectors by myself?
>
> Vectors?  Most outlines consist of second-order or third-order Bézier
> curves, not straight lines.  You can approximate those curves with
> straight lines by applying bisection to the Bézier curve until a
> certain threshold is reached.
>
>
>Werner
>
___
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Getting Vectors from a TTF font

2009-01-12 Thread Werner LEMBERG

> I'm currently trying to extract vectors from TTF fonts with freetype
> (via outline.points[].x or outline.points[].y).  But the problem is
> that sometimes, those vectors give me ugly chars.  Is there any
> possibilty to extract more vectors from the TTF (to increase
> resolution) or must i use bitmap and get vectors by myself?

Vectors?  Most outlines consist of second-order or third-order Bézier
curves, not straight lines.  You can approximate those curves with
straight lines by applying bisection to the Bézier curve until a
certain threshold is reached.


Werner


___
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype