SDL_FontCache icon indicating copy to clipboard operation
SDL_FontCache copied to clipboard

Wrong font outline for non-ASCII characters

Open freedan42x opened this issue 2 years ago • 0 comments

As you can see in the screenshot, the text itself is rendered correctly, but its outline is not: for ASCII characters it is facing bottom-right, but for UTF8 ones it's top-right.

image

Is there some way to offset outline for UTF8 characters? The rendered string contains both ASCII and UTF8 characters, and the one naive solution I can see is splitting them into 2 separate strings, check if it is UTF8, and if so, render with y offset, but that just seems inefficient. I render outline with FC_SetSpacing(font_outline, -2). I tried checking mentions of "outline" in source code, but I didn't succeed in finding where the problem at. I also tried different fonts, and it seems that the problem is not font-related. I also tried to render the text via SDL_ttf, but it works there no problem. And I really don't want to switch back. Can someone help, please?

freedan42x avatar Aug 14 '22 13:08 freedan42x