Using FreeType2 with OpenGL on Xcode 4

1.1k views Asked by At

I am currently using Xcode 4.2.1 on OSX Lion 10.7.2 and I am trying to use my own font (MankSans.ttf) to display a string on the screen with OpenGL. I tried following the tutorial on this site:

http://www.freetype.org/freetype2/docs/tutorial/step1.html

But it doesn't seem to work with Xcode 4.2.1. I have also tried looking at other sites, but they also have not worked for me. Is there any easier way other than using FreeType2 to load your own font, or is this the only way? If someone could, can you post your own code if you have been successful with using FreeType2?

Thanks

1

There are 1 answers

0
datenwolf On

You can't just (mindlessly) paste those code snippets from the tutorial text into a source file. Seriously people, aren't you reading and trying to understand what's happening in a code snippet, and what may be missing? Those ellipses (that's this -> '…') are a clear indicator that's this is not a fully working piece of code.

At the end of the tutorial there's written the following:

A complete source code example can be found here.

So why didn't you just grab this source file?