SDL_ttf 1.2 won't compile w/ VC++6.0 & generic question

Hi all,

I cannot compile SDL_ttf 1.2 under VC 6.0. I get the following error:

\SDL_ttf-1.2.0\SDL_ttf.c(298) : error C2036: ‘void *’ : unknown size

the code for this line is:
pixmap = glyph->pixmap.bitmap + row*glyph->pixmap.cols;

This is in the BOLD style handling section.

I commented the line and it compiled. (of course if i try to use the bold
style it crashes. It also crashes with SDL_RenderText_Blended (i don’t know
if it has to do with the above error))

Also i would like to ask something more generic about truetype fonts…When
i use RenderText_Shaded, it uses the foreground color for solid typing and
the background color for the edges (dithering?). Is this normal? Because if
i set the background color as colorKey and then blit the text, i get some
ungly background colored pixels at the edges of fonts…
Here is an example to clarify this:

screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);
SDL_FillRect(screen, NULL,SDL_MapRGB(screen->format, red.r, red.g, red.b));
SDL_UpdateRect(screen, 0, 0, 0, 0);
font = TTF_OpenFont(“verdana.ttf”, 72);
sprintf(string, “ABCDEFG”);
text = TTF_RenderText_Shaded(font, string, black, white);
SDL_SetColorKey(text, SDL_SRCCOLORKEY|SDL_RLEACCEL,
SDL_MapRGB(text->format, white.r, white.g, white.b))
temp = SDL_DisplayFormat(text);
SDL_FreeSurface(text);
text = temp;
dstrect.x = 4;
dstrect.y = 4;
dstrect.w = text->w;
dstrect.h = text->h;
SDL_BlitSurface(text, NULL, screen, &dstrect);
SDL_FreeSurface(text);
SDL_UpdateRect(screen, 0, 0, 0, 0);

As you see i render the text with black as foreground color and white as
background color. Then i set the colorkey to white and blit to a red screen.
My text is black with white edges…
Why isn’t it using only variants of the foreground color for the edges of
the fonts?

Thanks in advance,

Dimitris

I cannot compile SDL_ttf 1.2 under VC 6.0. I get the following error:

Thanks, I just fixed it. Look for SDL_ttf-1.2.1.tar.gz on the web site.

Also i would like to ask something more generic about truetype fonts…When
i use RenderText_Shaded, it uses the foreground color for solid typing and
the background color for the edges (dithering?). Is this normal?

Yes, the text is dithered by shading from background to foreground.
Use RenderText_Blended() if you want true blending with the background.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software