-
Notifications
You must be signed in to change notification settings - Fork 131
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
API: Support non-rounded outlines in TTF_SetFontOutline #422
Comments
I think passing through the stroker parameters is reasonable. What are the set of parameters you would need here? |
That's a good question. I'll try a few combinations with the freetype library directly to understand which combination works best for pixel fonts, and circle back with the results. My suspicion is that |
I tried all 12 combinations of linecap and linejoin and none of them render the pixel outline properly. I end up with either round corners or angle corners. I'll have to fall back to rendering the text 9 times instead. I'll close this bug since there isn't much SDL_ttf can do here. Sorry for the noise 😞 |
I just realized I forgot to change the miter parameter when calling So this would be the correct code to get pixel fonts rendering sharply:
|
Interesting, I'll see if I can add something for SDL_ttf 3.0. Thanks! |
TTF_SetFontOutline
always produces rounded outlines, which looks great for most fonts, but not for pixel art fonts. Here is an example:It would be great to support non rounded outlines too, configurable with a flag, to get blocky outlines instead in those cases. This is how it should ideally look when the non-ronded flag is ON:
As a workaround, the same effect can be achieved by rendering the text 9 times, but SDL_ttf has an opportunity to do it more efficiently by controlling
FT_Stroker_LineJoin
andFT_Stroker_LineCap
when callingFT_Stroker_Set
.An alternative could be to expose functions that allow controlling the line join and line cap of the outline, allowing all the variants supported by the freetype library.
The text was updated successfully, but these errors were encountered: