> > >> Actually I want to extract the file pointer from the input stream. > >> For this I initially used (FILE*)stream->descriptor.pointer to get > >> the pointer but it did not allocate the pointer and gave a > >> segmentation fault with fseek. > > >Don't use FreeType internals outside of the library. Look into the > >FreeType demo file `src/ftcommon.c' for an example of file handling. >
OK. But I am not using this outside the library but in the driver itself. >> I then did an explicit fopen on the filename later and my code ran > >> properly. > > >This sounds like the right solution. > >> Now the problem is that I cannot extract file pointer from the > >> stream. > > >Why do you need it? What problem do you want to solve? > I just need the file pointer outside the stream to extract the font specific values from the font file. The problem which I am facing is that the ` stream->descriptor.pointer` is not returning a correct pointer to the file and thus causing errors. I tried finding the error in the FT_Stream_Open function but could not find the problem. And using fopen explicitly twice might create errors later. Can you suggest a better way to get the file pointer from the input stream? > Also, if STREAM_FILE is already defined to be used to ease the > > process, then why is it showing undefined symbol? > > >Again: It is a macro, only *locally* defined (in `ftsystem.c'). If > >you use it in another file, the compiler treats it as an undefined > >symbol. > Ok. Now I get that. Thanks. -- Parth
_______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel