SDL ttf: Difference between revisions

From LD Smith Games Workshop
Jump to navigation Jump to search
Line 25: Line 25:
Select "stable release" and pick the Source Forge link
Select "stable release" and pick the Source Forge link


Select "Download Now" ft2311.zip
Download freetype-2.3.11.tar.gz


Save the zip to the SDL_ttf directory
Unzip
  gzip -d freetype-2.3.11.tar.gz
  chmod u+wr freetype-2.3.11.tar
  tar -xvf freetype-2.3.11.tar


Unzip
Build freetype
 
  cd freetype-2.3.11
  ./configure
   


    
    

Revision as of 20:17, 22 November 2009

I am attempting to use SDL_ttf for writing text to the screen. Currently, I just use bmps and pings for the menu text, but that process really isn't going to work when I want to write variable data (like FPS, level complete time, etc) to the screen.

Installing Development Files

Again, I am using cygwin with the gcc compiler under Windows.

Download SDL_ttf-2.0.9.tar.gz from http://www.libsdl.org/projects/SDL_ttf/

Rename to .tar.gz if Windows changed the extension to .tar.tar

  mv SDL_ttf-2.0.9.tar.tar SDL_ttf-2.0.9.tar.gz

Extract

 gzip -d SDL_ttf-2.0.9.tar.gz
 tar -xvf SDL_ttf-2.0.9.tar

If you get a permission denied error, then chmod the tar file

 chmod u+rw SDL_ttf-2.0.9.tar
 tar -xvf SDL_ttf-2.0.9.tar

Download the Freetype library at http://www.freetype.org

Select "stable release" and pick the Source Forge link

Download freetype-2.3.11.tar.gz

Unzip

 gzip -d freetype-2.3.11.tar.gz
 chmod u+wr freetype-2.3.11.tar
 tar -xvf freetype-2.3.11.tar

Build freetype

 cd freetype-2.3.11
 ./configure
   


Build the library

 cd SDL_ttf-2.0.9
 ./configure

Distributing

Download SDL_ttf-2.0.9-win32.zip from http://www.libsdl.org/projects/SDL_ttf/

Extract the DLLs to the project directory