Jump to content
  • Advertisement
Sign in to follow this  
sdlprorammer

SDL Your method for text

This topic is 5048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

:'( This really pisses me off. Not being able to print text in the screen is painful ( you can only draw it with images ). So i thought someone could be using something different instead of always having to have a special image with the aphabet to print text. Do you all include the text image in the data folder of your projects, or do you do a magical trick? Thanks..

Share this post


Link to post
Share on other sites
Advertisement
What daeron said. SDL_ttf is probably the best solution to display text with SDL. It even supports Unicode and anti-aliased fonts.

It doesn't rely on a font being installed in the user's system. You supply the font yourself with your game. (I'm mentioning this because this is what scared me off at first from using a TTF library.)

If you want something simpler (in terms of size; SDL_ttf is easier to use), check out SFont at http://www.linux-games.com/sfont/ - it loads fonts from an image file. Of course, it's restricted to ASCII characters.

SDL_gfx also includes a simple, built-in font renderer including a font.

Share this post


Link to post
Share on other sites
thank you for the replies... but SDK__ttf does require you to supply a font ( http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_frame.html ). or am i wrong?

edit how do i make a link work..?

Share this post


Link to post
Share on other sites
Quote:
Original post by sdlprorammer
thank you for the replies... but SDK__ttf does require you to supply a font ( http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_frame.html ). or am i wrong?

edit how do i make a link work..?
Yes, you have to suppy a font. Google for the "Bitstream Vera" fonts, which very nice, and freely redistributable.

Links are plain html:

<a href="http://www.website.com">text to show</a>


Don't forget the http:// part, or it won't work.

Share this post


Link to post
Share on other sites
Or you can just make your own text fucntions, it takes only a few hours of coding, and you get some experience as well, plus you don't need any dependencies, and you can customize it to whatever extent you want.

Share this post


Link to post
Share on other sites
Try SFont.

It's great if you don't want to use a font file, but want to use a bitmap font, which for me, was easier than creating a .ttf for my font.

Really simple and easy to use.

-Skitzo

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!