[SDL] Border around text with TTF_RenderText

Sam Crow samuraileumas at yahoo.com
Fri Jun 8 20:06:22 PDT 2007


In order to get a simple border around each letter you have to draw your text 
to a surface, and do a masked blit of that surface 9 times with the last one 
being the center position.

In other words, blit border color to destination surface position x-1,y-1 then
x,y-1 then x+1,y-1 then x-1,y then x+1,y then x-1,y+1 then x, y+1 then x+1, y+1
then you draw the color you want for your text itself at x,y.  At least that's 
how it's done with bitmap fonts...



More information about the SDL mailing list