SFML community forums

Help => Graphics => Topic started by: eishiya on July 17, 2020, 08:01:17 pm

Title: Text outline incorrect on bitmap TTF
Post by: eishiya on July 17, 2020, 08:01:17 pm
I'm using a font which is a TTF with an embedded bitmap, and empty outlines for all the glyphs. SFML renders the glyphs correctly (shows the bitmaps, and not the empty outlines), but if I try to use an outline with this font, it appears to outline the empty font outlines rather than the bitmaps, producing squares behind the text instead of an outline.

Here's an example with 2px black outlines:
(https://i.imgur.com/wn4FnwM.png)

If I use an all-outline font, the outlines are correct. I have not tested with pure bitmap fonts because I don't have any that are compatible with SFML.
Title: Re: Text outline incorrect on bitmap TTF
Post by: eXpl0it3r on July 23, 2020, 08:08:15 am
SFML just uses Freetype to read the font information. If the font doesn't support outlines properly, then there's nothing SFML can do.
You could look into some outline shader that would trace the pixel of your text.
Title: Re: Text outline incorrect on bitmap TTF
Post by: eishiya on July 23, 2020, 03:21:51 pm
SFML just uses Freetype to read the font information. If the font doesn't support outlines properly, then there's nothing SFML can do.
Are the text outlines not generated by SFML, though? Can SFML not choose which data to use as the base for them, just as it chooses whether to display the vector outline or the bitmap for the glyph?