No antialiasing with sdl ttf?

I’m having a bit of trouble with sdl ttf where text I draw doesn’t look very antialiased. Here’s my code. Here’s an example of what it looks like:

SFML looks markedly better. What’s going on here?

I had the same issue: while calling TTF_RenderText_Blended I had the same display as with TTF_RenderText_Solid .

After a lot of trials, I discovered that the problem are related with the TTF_OpenFont call, and subject both to the font name and to the ptsize variations.

For example, TTF_OpenFont(“calibrib.ttf”, 12) i.e. with ptsize=12 was not antialiased .
I had the same result with ptsize 13 to 17, but antialiasing worked for the following ptsize values: 10, 11 or 18!

It seems to remember that I had not the same problem with the Arial font for example.

Thus, I believe that the issue is not related to SDL_ttf but to the font file?