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
1 answer
How to blur SDL_Surface without shaders?
I want to add blur effect to drawing text. I use SDL2 and SDL_TTF.
SDL_Surface has a transparency.
How to do it without shaders?
Below is the algorithm that I use. This is a simple averaging.
Uint32 p;
Uint8 r, g, b, a;
int x, y,…

loki
- 314
- 4
- 17
0
votes
1 answer
Cannot find SDL.h when
I'm trying to use TTF for the games I want to develop, I'm fairly new to this so I would thank you a lot if you could answer a question for me:
After I followed the installation instructions correctly (at least I hope i did) I tried to compile my…

DemetrioProgramerOsorio
- 124
- 1
- 11
0
votes
1 answer
ttf Text wont show up in SDL
No matter what i try i cant get my text to load into a texture in SDL 2.0 using SDL_ttf.
Here is my textToTexture code
void sdlapp::textToTexture(string text, SDL_Color textColor,SDL_Texture* textTexture)
{
//free prevoius texture in…

JustinWeq
- 158
- 11
0
votes
0 answers
C++ SDL OpenGL getting Access violation
I'm trying to use SDL_ttf to render text on OpenGL, but every time I try to get the pixels from a SDL_Surface, it throws the following error:
Unhandled exception at 0x1000a590 in L2DF.exe:
0xC0000005: Access violation reading location…

dcubix
- 187
- 2
- 10
0
votes
1 answer
SDL_TTF Rendering in the wrong place
I have been developing with SDL for a while now,
but thought i needed another challenge.
So I decided to draw some text on the screen using SDL_TTF.
I try to render the text at 0,0 but it is a bit below the screenborder.
So that means it is not…

markieo
- 484
- 3
- 14
0
votes
2 answers
sdl_ttf iOS wrong entry point
I have been trying out SDL for iOS, and it has been going smoothly until I added sdl_ttf to the mix. The only output that I would get was
apinames 0.1: extract FreeType API names from header files
this program is used to extract the list of public…
user3127458
0
votes
1 answer
How to transform SDL TTF Surface into GL Texture with Transparent background
I would like to draw text over content drawn in GL. I want the symbols themselves to be opaque, whilst the rest transparent, allowing the drawn content to be seen. The following code yields a text, which is the correct one, yet with a perfectly…

user3228136
- 157
- 6
0
votes
2 answers
sdl ttf windows-1250 encoding
In file text.txt I have this sentenc:
"Příliš žluťoučký kůň úpěl ďábelské ódy."
(I think Windows uses Windows-1250 code page to represent this text.)
In my program I save it to a buffer
char string[1000]
and render string with ttf to SDL_Surface…

Fanda
- 325
- 5
- 14
0
votes
2 answers
How do I tell Homebrew that I indeed do satisfy a sdl_ttf library dependency for installing pygame?
I am new to brew and have been using it to great effect until now. I am trying to install pygame, and it is not letting me get past one of the dependencies, sdl_ttf. I am running OS X 10.9 (Mavericks). The bottom line is that I have now downloaded…

user391339
- 8,355
- 13
- 58
- 71
0
votes
1 answer
Using SDL_TTF as a class, memory leak
I have a huge memory leak which is making me question my implementation of SDL_TTF as a whole.
Right now I have the following classes
MainMenu
Menu
Options
Button
Text
The MainMenu and Option classes abstract the menu class and each call their…

Elias
- 2,602
- 5
- 28
- 57
0
votes
0 answers
Rendering multiple paragraphs of text?
For the past few days, I've been making a bunch of low quality games as a practice, most of them only involved little to no text, but this time, I wanted to make a real game, a simulation one that would rely heavily on dialogues, my way of rendering…

kdyz
- 1,447
- 13
- 27
0
votes
1 answer
SDL2 Access violation multiple windows
I am developing SDL2 application which needs to have multiple windows on multiple monitors. And I am getting access violation when drawing string with SDL_ttf library. I should also mention that Application is opening windows in separate threads and…

Nebojsa
- 1
- 2
0
votes
1 answer
SDL_ttf and OpenGL are outputting seemingly random garbage and crashes
I'm trying to write a basic program to render text in OpenGL using SDL_ttf. I have seen around a dozen questions answered on how to get the two to work together, almost all of which provide code that looks similar to what I'm using. I've seen no…

Novice
- 13
- 1
0
votes
0 answers
I got this function that make my program crash
I am trying to make a text box so i made this function to show text on screen,
i have a fps regulator, so the function is called 33 times a second.
I have an old computer (64 mb video ram and 1 ram + Pentium 4 CPU 2.8GHz)
when i remove this…

user3105169
- 1
- 3
0
votes
1 answer
I am using SDL and this function cause my program to use all of my memory
I am a beginner to C++ and this function cause the memory of my program to continuously raise.
It's called in a while loop and it never stop.
void text_box()
{
SDL_Surface *MESSAGE1 = TTF_RenderText_Solid( font, "Ligne #1" , noir ); …

user3105169
- 1
- 3