Advertisement

[FreeType] FT_New_Face Crashing?

Started by December 11, 2011 06:41 PM
-1 comments, last by stu_pidd_cow 12 years, 11 months ago
I'm trying to set up FreeType to work on VS2008. I've managed to get everything to compile and link properly, but whenever I call FT_New_Face the program crashes to the _file.c file at line 242. Here is the code I'm using at the moment:

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma comment( lib, "freetype248.lib" )
#include <ft2build.h>
#include FT_FREETYPE_H

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
FT_Library library;
int error = FT_Init_FreeType( &library );
if ( error )
MessageBox( 0, "Error with library", "Error", 0 );

FT_Face face;
error = FT_New_Face( library, "test.ttf", 0, &face ); // THE ERROR IS HERE!!
if ( error == FT_Err_Unknown_File_Format )
MessageBox( 0, "Unknown format", "Error", 0 );
else if ( error )
MessageBox( 0, "Error with face", "Error", 0 );

return 0;
};



test.tff is a valid TFF file (I've tried different files). The call stack is a bit like this (if it helps):
_FT_New_Face()
_FT_Open_Face()
_FT_Stream_New()
_FT_Stream_Open()
fseek()

Any help is much appreciated. Or if you can point me to a resource that shows how to install it correctly, that would also be great.
Thanks.

This topic is closed to new replies.

Advertisement