Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Text outline incorrect on bitmap TTF  (Read 1807 times)

0 Members and 1 Guest are viewing this topic.

eishiya

  • Newbie
  • *
  • Posts: 5
    • View Profile
Text outline incorrect on bitmap TTF
« 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:


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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Text outline incorrect on bitmap TTF
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eishiya

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Text outline incorrect on bitmap TTF
« Reply #2 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?