Hi!
Today I tried SDL_ttf 2.0.2. All worked fine until I tried to create a
red blended text (same goes to blue). Green worked fine. I hacked a small
example (no error checking, so if anything fails, it fails), which you can
try. compile done with:
gcc test-sdl_ttf2.c -o test-sdl_ttf2 $(sdl-config --cflags --libs) -lSDL_ttf
And as an attachment there is graffiti.ttf.gz.
Please verify this strange thing. BTW, when will there be a cropped surface
after TTF_RenderText_xxx?
main ()
{
SDL_Surface *screen, *surf[3];
TTF_Font *font;
char *txt[3] = { “red hugo”, “blue hugo”, “green hugo” };
SDL_Color col[3] = { { r: 0xff, g: 0x00, b: 0x00 },
{ r: 0x00, g: 0x00, b: 0xff },
{ r: 0x00, g: 0xff, b: 0x00 }};
SDL_Rect rect;
SDL_Event event;
int i;
atexit (SDL_Quit);
SDL_Init (SDL_INIT_VIDEO);
TTF_Init ();
screen = SDL_SetVideoMode (640, 480, 16, SDL_DOUBLEBUF | SDL_HWSURFACE);
font = TTF_OpenFont (“graffiti.ttf”, 40);
TTF_SetFontStyle (font, TTF_STYLE_NORMAL);
for (i = 0; i < 3; ++i)
{
rect.x = i * 40;
rect.y = i * 40;
surf[i] = TTF_RenderText_Blended (font, txt[i], col[i]);
SDL_BlitSurface (surf[i], NULL, screen, &rect);
}
TTF_CloseFont (font);
SDL_Flip (screen);
for (;
{
while (SDL_PollEvent (&event))
{
switch (event.type)
{
case SDL_QUIT:
exit (1);
}
}
}
}
so long
Thomas–
__
/\ Thomas Krennwallner
( ^ > Fingerprint: 7B58 6ED2 676F 75D8 4DD1 5A83 DC68 E62F 85F3 D58F
/ \ Phone: +43 2252 810810 18
(/)
E. Moritz GmbH
office at e-moritz.at
http://www.e-moritz.at/
-------------- next part --------------
A non-text attachment was scrubbed…
Name: graffiti.ttf.gz
Type: application/x-gunzip
Size: 16399 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010515/f37dccbb/attachment.bin