[SDL] Strange SDL_TTF problem (repost)

SkunkGuru skunkguru at gmail.com
Wed Nov 2 13:09:24 PST 2005


(I hope that all the list receives this message,
this time... let me know if it's ok)

I have a small game that uses SDL and SDL_TTF.

With official SDL_TTF DLL v2.0.6 it's ok.

With official SDL_TTF DLL v2.0.7 I notice
that texts are not very good-looking...

I don't know how to explain the problem,
so I attach 2 samples (only 6kb)...

bad.png  is with SDL_ttf v2.0.7
good.png is with SDL_ttf v2.0.6

I get this by *only* replacing the DLL file...
(no changes in code, no changes in other DLL)

I tryed with my compiled program (.exe)
- one folder with the .exe and the old DLL
- one folder with the .exe and the new DLL
(and the same sdl.dll and font.tff)

I run the programs, and take the snapshots

My system is WindowsXP.

I've also tryed both SDL.dll v1.2.8
and SDL.dll v1.2.9 with the same problem.
(official dll files from devel package)

This is a minimal program...
and I still get the same problem...

I've also tryed changing the font file :-(

#include "SDL.h"
#include "SDL_TTF.h"

int main( int argc, char* argv[] )
{
    SDL_Init(SDL_INIT_VIDEO);
    TTF_Init();

    SDL_Surface* screen = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE);

    TTF_Font* Font = TTF_OpenFont("font.ttf", 16);
    TTF_SetFontStyle(Font, TTF_STYLE_NORMAL);

    SDL_Color myCol;
    myCol.r = 255; myCol.g = 255; myCol.b = 255;
    SDL_Surface* Surface2 = TTF_RenderText_Solid(Font, "this is a test 
string" , myCol);

    SDL_Rect myRect;
    myRect.x = 320;
    myRect.y = 240;

    SDL_BlitSurface(Surface2, NULL, screen, &myRect);
    SDL_Flip(screen);

    SDL_Delay(2000);

    return 0;
}


Any idea ?


Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad.PNG
Type: image/png
Size: 2249 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051102/4225ec02/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good.PNG
Type: image/png
Size: 2127 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051102/4225ec02/attachment-0017.png>


More information about the SDL mailing list