Weird black pixels around TTF text |
MikeyPro
|
Either 1) the surface you create has the wrong format, or 2) The font you're using is causing it.
I would first try simplifying your method, liike my code below:
Secondly, if that doesn't solve it, try a different font. Try a couple different fonts. |
|||||||||||||
|
luca00555
|
Will do, another thing I've been thinking about, you could also make the text non anti aliased and 8x bigger than requested format. That way, you'll size it down and texture filtering will do the smoothing.
|
|||||||||||
|
luca00555
|
I have found the problem, when directly converting the text surface into a texture everything seems okay.
When doing it my way, SDL_BlitSurface(textSurfaceTemp, NULL, textSurface, &rect); causes alpha value of letter edges to turn dark. How can I fix this or do it without SDL_BlitSurface();? |
|||||||||||
|
luca00555
|
I fixed it by putting SDL_FillRect(textSurface, NULL, SDL_MapRGBA(textSurface->format, textColor.r, textColor.g, textColor.b, 0)); after
textSurface = SDL_CreateRGBSurface(0,width,height,32,0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); |
|||||||||||
|
luca00555
|
Final result:
|
|||||||||||||
|
MikeyPro
|
Have you tried using TTF_SetFontHinting???
|
|||||||||||
|