freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] Using FT_Outline_Decompose.


From: Brian Stell
Subject: Re: [Freetype] Using FT_Outline_Decompose.
Date: Wed, 19 Mar 2003 22:05:19 -0800

~ wrote:
> 
> Hi, I'm a bit confused about how how to initialise the 
> 'func_interface' argument  that is passed into FT_Outline_Decompose. 
> In other words, what are the functions that are pointed to by the 
> function pointers in FT_Outline_Funcs ? 

They point to your functions to do whatever you would like
with the info.

> I assume that I need to somehow assign the correct addresses to 
> the function pointers before passing them into FT_Outline_Decompose. 

Correct.

> And while I'm at it, what is the meaning of the third argument 
> user - do I just need to pass in a void *  and that's it ?

Its a pointer to any data you want to make available to your
functions. If you don't need anything then null is okay.

> Does anyone have any example code of the usage of FT_Outline_Decompose
> that shows the correct way to call this function and
> how to interpret / use the results returns.

There is code in mozilla that converts Truetype to postscript
for printing. Here is the call:

http://lxr.mozilla.org/seamonkey/source/gfx/src/ps/nsType1.cpp#407

  rv = aFt2->OutlineDecompose(&slot->outline, &ft_outline_funcs, &fti);

The aFt2->OutlineDecompose is a pointer based call to 
FT_Outline_Decompose. The moz code uses a pointer to the function
so it can to run even when the FreeType lib is not available (of 
course without this feature).

The function struct is defined here and the functions are 
nearby:
http://lxr.mozilla.org/seamonkey/source/gfx/src/ps/nsType1.cpp#364

 static FT_Outline_Funcs ft_outline_funcs = {
   moveto,
   lineto,
   conicto,
   cubicto,
   0,
   0
 };

-- 
Brian Stell



reply via email to

[Prev in Thread] Current Thread [Next in Thread]