Jump to content

  • Log In with Google      Sign In   
  • Create Account


freetype fonts


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
3 replies to this topic

#1 ConflictEnsues   Members   -  Reputation: 102

Like
0Likes
Like

Posted 05 April 2013 - 01:02 AM

I am trying to implement the freetype font method shown in

http://nehe.gamedev.net/tutorial/freetype_fonts_in_opengl/24001/

 

with some of my own code.  I am using Windows 7 and Codeblocks with MinGW.

 

 

The issue I am running into is that when I try to call

our_font.init("usuzv2i.ttf", 16);

I get a popup box saying "This application has requested runtime to terminate it in an unusual way."  It then immediately crashes. 

There's a decent chance I'm encountering a problem with the below because I don't have the file setup right but I don't know.  I downloaded "usuzv2i.ttf" and put it in my active directory.

// This Is Where We Load In The Font Information From The File.
        // Of All The Places Where The Code Might Die, This Is The Most Likely,
        // As FT_New_Face Will Fail If The Font File Does Not Exist Or Is Somehow Broken.
        if (FT_New_Face( library, fname, 0, &face ))
            throw std::runtime_error("FT_New_Face failed (there is probably a problem with your font file)");

 



Sponsor:

#2 Daerst   Members   -  Reputation: 227

Like
1Likes
Like

Posted 05 April 2013 - 02:37 AM

Are you sure that the font file is in the current working directory? For example when developing in Microsoft Visual Studio, the location of the .exe file will NOT be the working directory by default! You could try checking whether the file exists before trying to open it using ifstream or something similar.

 

Another possibility (though is consider it unlikely) is, like it says in the comment, that the file is somehow broken. If the above doesn't help, try downloading it again.



#3 ConflictEnsues   Members   -  Reputation: 102

Like
0Likes
Like

Posted 05 April 2013 - 05:19 PM

Thankyou; progress!

 

I put the dll's in what i had taken to be the active directory and ran the executable.  The program ran so I guess that was the active directory.

 

Unfortunately that means I need to do something so codeblocks knows where to find the file.  I've been messing around with directory settings but haven't figured it out yet.



#4 ConflictEnsues   Members   -  Reputation: 102

Like
0Likes
Like

Posted 05 April 2013 - 05:25 PM

under

project properties->build targets->objects output directory

specifying the path there fixes it ^.^






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