[SDL] Strange SDL_TTF problem (repost)
tayl0270 at flinders.edu.au
Wed Nov 2 23:33:11 PST 2005
It looks like the 'bad' fonts have been rendered with the bytecode interpreter
switched off. The bytecode interpreter can only be used legally with a licence
from Apple as it uses their patents. To switch it on, in the freetype source
code, find the file include/freetype/config/ftoption.h and remove the comments
(or #undef, depending on the version you have) so there's a line that reads:
Quoting SkunkGuru <skunkguru at gmail.com>:
> (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_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);
> return 0;
> Any idea ?
More information about the SDL