Jump to content

  • Log In with Google      Sign In   
  • Create Account


[FreeType] FT_New_Face Crashing?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 stu_pidd_cow   Crossbones+   -  Reputation: 1726

Like
0Likes
Like

Posted 11 December 2011 - 12:41 PM

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.

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS