Jump to content
  • Advertisement
Sign in to follow this  
stu_pidd_cow

[FreeType] FT_New_Face Crashing?

This topic is 2445 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!