> When the gf driver enters the gf_load_font in gflib.c, if we use
> stream->descriptor.pointer to get the file pointer and comment out
> the fopen I get a segmentation fault. And if the fopen is used it
> works fine.
>
> Like here:
>
> FT_FILE* fp = (FT_FILE*)stream->descriptor.pointer;
>
> /* Errors with STREAM_FILE( stream ) */
> /* stream->descriptor.pointer is not allocating */
> /* the file pointer properly */
>
> char* st = (char*)stream->pathname.pointer;
> fp = fopen ( st, "rb" );
There is not a single font driver in FreeType that uses `FT_FILE'.
It's definitely the wrong interface. FreeType either accepts font
files or fonts that are preloaded into a memory buffer. For the
latter you can't use `fopen' and friends; this is another reason for
being the wrong interface.
Function `gf_load_font' gets an `FT_Stream' object; this means you can
use the FT_STREAM_XXX macros, for example `FT_STREAM_SEEK'.
I suggest that you have a look (again :-) into `winfnt.c'.
Werner
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel