[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [linuxgames] drawing a string using SDL



On Wed, Dec 17, 2003 at 01:43:35PM +0530, Abhir Joshi wrote:
> As of now, I blit BMP images containing the text.  But the images need
> to recreated using GIMP whenever the text is to be changed.  What if I
> want to print arbitrary text at runtime?  Do I need to have a bitmap
> for each and every character and then blit those bitmaps according to
> the characters in the string?

That's one way of doing it.


> Is there some library already written for this?

The most basic library is SDL_ttf.  But there are other libraries that
provide some more functionality, which either use SDL_ttf in the end, or
use bitmap fonts.

I used SDL_ttf (and wrote my own word-wrapping routines) in Tux Paint.

-bill!
bill@newbreedsoftware.com                           Got kids?  Get Tux Paint! 
http://newbreedsoftware.com/bill/       http://newbreedsoftware.com/tuxpaint/