This is a sample library which allows you to use TrueType fonts in your SDL applications. It comes with an example program "showfont" which displays an example string for a given TrueType font file.
Questions tagged [sdl-ttf]
208 questions
0
votes
0 answers
SDL_ttf surface to OpenGL texture channels mismatch
I trying to make OpenGL texture from SDL_ttf surface for score GUI in my game:
SDL_Color scoreColor = { 255, 255, 255, 255 };
SDL_Surface *score = TTF_RenderText_Blended(font, "0 : 0", scoreColor);
SDL_Surface *scoreScaled = SDL_CreateRGBSurface(0,…

Nyan Cat
- 303
- 1
- 5
- 14
0
votes
1 answer
Linking SDL_ttf library in C++
I'm having a problem linking SDL_ttf library with C++ compiler. I have tried three different programs and i couldn't solve the problem in any of them. I've tried Dev C++, Eclipse and CodeBlocks. In all of them it appeared a different error, but all…

user2976095
- 1
- 1
- 2
0
votes
1 answer
SDL2 program SIGSEGV on start
I wrote Snake in SDL and now want to port it to Android, which means I had to rewrite parts of it to use SDL2. I replaced the key control and rendering parts and it compiles without any errors. However, when I try to run it it crashes immediately. I…

frankm1
- 61
- 7
0
votes
1 answer
SDL C++ Program crashes consistently after about 12 seconds
I am currently making a simple game with SDL in C++. When I compile and run the game in Ubuntu using the command line, the game runs perfectly without problems. However, when I try to compile the same code with Codeblocks in Windows 7, the program…

Ian Tait
- 607
- 1
- 8
- 16
0
votes
1 answer
How do I set up additional SDL libraries in CodeBlocks?
I want to set up SDL_Image, SDL_Mixer and SDL_TTF, but it doesn't seem to work. I'm following Lazy Foo's SDL tutorial and tried setting it up like he says, but it just doesn't work. I put all the include files into include folder, and all the lib…
user2588543
0
votes
1 answer
TTF_RenderUTF8_Blended Rendering Colored Text
I'm trying to render text using SDL_ttf and openGL.
I open the font and render the text to an SDL_Surface and then attached that surface to a texture and bind it for openGL to render it.
I have googled this issue a bunch and not getting many…

Chemistpp
- 2,006
- 2
- 28
- 48
0
votes
1 answer
Drawing text with SDL_ttf while using other graphics
I am making this game using SDL and I need to be able to text displayed for variables and information etc. The problem is I can't render any text while SDL_OPENGL is a parameter in
SDL_SetVideoMode().
It works perfectly without but then I cant…

2GG
- 23
- 2
0
votes
1 answer
Issues with undefined reference NDK
Ok I know that this has been brought up. Yet mine does not seem to be addressed.
Before we start let it be known the following:
OS: Win7 (x86)
IDE: Eclipse Juno (4.2)
NDK: r8e
Android API: 17 (Jelly Bean 4.2)
I am trying to get SDL_ttf to fully…

CoderBear
- 1
- 2
0
votes
1 answer
SDL2 & SDL_ttf - Best Practice
I have some basics set up in my game but I came to a point where I want to include font rendering (initially for debug output to the screen).
Looking at various tutorials and the SDL_ttf library I require clarification on something. The SDL_ttf will…

TPS
- 2,067
- 3
- 23
- 32
0
votes
1 answer
SDL_Surface Transparency Issues
I have been working with sdl ttf, Now, I'm creating a text renderer function for multiline text rendering.
I am creating a surface for each line, blitting in in a "global" surface, and then converting that "global" surface to a texture.
Actually My…

Spamdark
- 1,341
- 2
- 19
- 38
0
votes
1 answer
SDL ttf with opengl, font size issues
I am working with sdl ttf for rendering text to opengl, actually everything it's fine, but like you know, when you open a ttf sdl file you specify it on pixels, and you can't change the font size. Actually you can change the font size but you need…

Spamdark
- 1,341
- 2
- 19
- 38
0
votes
1 answer
Transparent SDL_Surface without background
I'm working with SDL and OpenGL.
I'm using SDL ttf for create a surface with the text, then create a texture with that surface.
I'm trying to apply an alpha channel (opacity) to the text, I'm using this way:
SDL_Surface * fontsurf =…

Spamdark
- 1,341
- 2
- 19
- 38
0
votes
1 answer
Trouble having SDL_TTF and OPENGL work together
For a game I'm working on, I'm hoping to use OpenGL for a lot of the graphics and SDL_TTF for the text. I can get both to work but not at the same time. Here's my code (based off Lazy Foo):
#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
#include…
0
votes
1 answer
How to draw solid text using sdl_ttf?
Here's an example:
SDL_Color textcol = {255, 255, 255};
SDL_Color backtextcol = {0, 0, 0};
SDL_Surface *mes = TTF_RenderText_Shaded(font, "The game has begun", textcol, backtextcol);
apply_surface(40, 40, mes, screen);
SDL_Flip(screen);
Thanks to…

Allok
- 737
- 1
- 7
- 19
0
votes
2 answers
SDL_ttf doesn't run correctly
I am using SDL_ttf but in mingw32, I download everything and try the following program
#include
#include "SDL_ttf.h"
#include
using namespace std;
const int window_width = 600;
const int window_height = 600;
TTF_Font…

user1285419
- 2,183
- 7
- 48
- 70