Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_ttf - gray outline around each letter #181

Open
MikeLorenz opened this issue Aug 18, 2019 · 2 comments
Open

SDL_ttf - gray outline around each letter #181

MikeLorenz opened this issue Aug 18, 2019 · 2 comments

Comments

@MikeLorenz
Copy link

Hi:

Great library, just discovered it!

So far everything is working great, although I did notice that when I use SDL_ttf to render letters, there's a thin gray border around them. When I change the code to remove SDL_gpu and just use vanilla SDL2, no borders, which is what I would expect.

I'm attaching sample output, along with two the C files I used to produce them. (I'm not attaching font files, since I assume you can substitute any files.

Thanks,
Mike

Screenshot 2019-08-18 13 48 13 SDL

Screenshot 2019-08-18 13 49 10 GPU

TTF GitHib issue C source.zip

@grimfang4
Copy link
Owner

This looks like inadvertent color blending with transparent pixels. The best solution for this generally is premultiplied alpha. In this case here, you may be able to get the result you want by setting the filtering mode (GPU_SetImageFilter()) to GPU_NEAREST.

If that's not good enough, let me know to look into this further.

@MikeLorenz
Copy link
Author

Sorry to say, GPU_SetImageFilter() didn't change anything. FWIW, I'm not sure I'm actually going to end up using SDL_ttf anyway (it's just convenient for prototypes), but of course maybe this issue is indicative of some other potential problem, I don't know. In any case, thanks for the speed reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants