SDL Your method for text
:'( 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..
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.
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.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
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..?
edit how do i make a link work..?
Quote: Original post by sdlprorammerYes, you have to suppy a font. Google for the "Bitstream Vera" fonts, which very nice, and freely redistributable.
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..?
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.
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.
IIRC, the SDL_ttf demos file comes with a couple of fonts which may be used freely. Those are from the freefonts project.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement