If I do this (as in the SDL_ttf showfont.exe test app) my true type font looks
great:
- Call TTF_RenderText_Solid() which returns a newly created SDL_Surface with
the text printed with the true type font. - Call SDL_BlitSurface() to blit to the screen.
With the above steps it is smooth and antialiased. Unfortunately what I have
to do for our text and textbox classes is to blit to an additional
intermediate surface before blitting to the screen.
- Call TTF_RenderText_Solid() which returns a newly created SDL_Surface with
the text printed with the true type font. - Call SDL_BlitSurface() to blit to the text or textbox surface.
- Blit the surface in #2 to the screen.
This looks bad. We lose all of the alpha data so what we get is only the
pixels that had full Alpha getting drawn; anything that had partial alpha does
not show up.
I have tried converting the surfaces, setting SRCCOLORKEY, setting SRCALPHA,
etc. I have also tried using TTF_RenderText_Blended(). Nothing makes a
difference.
Well, that isn’t strictly true, when I use TTF_RenderText_Blended() there is a
combination that DOES seem to blit the extra pixels that had an alpha
component, but instead of showing up in the font color (black), they show up
in blue on some screens and white on others. Very weird and odd.
Any ideas? Anything you can suggest would be appreciated.
- Ken