SDL_ttf & Mac OS Classic

I am trying to port TuxTyping 2 to Mac Classic (for schools). I had successfully ported it in the past but after getting another old mac and installing MPW and all the SDL libraries (the latest ones SDL_ttf 2.0.6, …)

I got the Mixer & Image libaries working, but I cannot get TTF_OpenFont to work.

I cut down to the smallest possible example:

#include “SDL.h”
#include “SDL_ttf.h”

int main(int argc, char *argv[]) {
SDL_Surface *screen;
TTF_Font *font;

if (SDL_Init(SDL_INIT_VIDEO)<0)
exit(1);

screen = SDL_SetVideoMode(640,480,16,SDL_SWSURFACE);

if (TTF_Init() < 0)
exit(1);

font = TTF_OpenFont( “FreeSans.ttf”, 24 );
if (!font) {
printf(“font could not be loaded :(\n”);
exit(1);
}

printf(“everything worked!\n”);

return 0;
}----------------------------------

No problems compiling (the library was installed in exactly the same way as SDL_image & mixer and both of those libraries worked)

It always prints that the font cannot be loaded. I am using the freefonts from the GNU savanah Free Font project (TTF fonts). I have used the about every combination of things I can think of!

The funny thing is that if I try to open the font as a file (using fopen), it succeeds! so it doesn’t seem to be a pathing issue.

Thanks for any help in advance!

Jesse Andrews
http://tux4kids.net/~jdandr2

Message: 24

I am trying to port TuxTyping 2 to Mac Classic (for schools). I had
succes=
sfully ported it in the past but after getting another old mac and
instal=
ling MPW and all the SDL libraries (the latest ones SDL_ttf 2.0.6, …)

I got the Mixer & Image libaries working, but I cannot get
TTF_OpenFont to =
work.

Probably the only way to get to the bottom of this is to start
debugging SDL_TTF. Since (I recall) you are using MPW, this means
you’ll either have to go into SDL_TTF and sprinkle it with printf() or
learn to use MacsBug (Apple’s low-level debugger).On Tuesday, May 20, 2003, at 03:01 PM, sdl-request at libsdl.org wrote:

From: “Jesse David Andrews”
To: sdl at libsdl.org
Date: Tue, 20 May 2003 11:33:17 -0400
Subject: [SDL] SDL_ttf & Mac OS Classic
Reply-To: sdl at libsdl.org