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

Author Topic: Jagged edges on fonts  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Digital

  • Newbie
  • *
  • Posts: 10
    • View Profile
Jagged edges on fonts
« on: April 11, 2012, 07:44:07 am »
I'm using SMFL2 and the fonts are rendering with jagged edges as if they're not smoothed. It happens with any font. I tried searching for an answer and the closest topic I found was http://en.sfml-dev.org/forums/index.php?topic=6447.msg42613#msg42613
Unfortunately, the link Laurent gave isn't redirecting to the new forum, so I'm not sure where to go from here.  :-\


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Jagged edges on fonts
« Reply #1 on: April 11, 2012, 08:07:58 am »
Can you link to / upload the font that you use? I'll do some tests.
Laurent Gomila - SFML developer

Digital

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Jagged edges on fonts
« Reply #2 on: April 11, 2012, 08:23:07 am »
Here is the font. Thanks for taking a look.

http://www.urbanfonts.com/fonts/Elements.htm

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Jagged edges on fonts
« Reply #3 on: April 25, 2012, 01:59:41 pm »
Sorry for the very long reply.

I tested the font, and it appears antialiased as expected:


Here is my test code:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "test");

    sf::Font font;
    font.loadFromFile("Elements.ttf");

    sf::Text text("Play", font, 300);
    text.setColor(sf::Color::Red);
    text.setPosition(30, 30);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(text);
        window.display();
    }

    return 0;
}

Can you tell me what's your OS and version of SFML 2? Does the code above still produces aliased edges for you?

[attachment deleted by admin]
« Last Edit: April 25, 2012, 02:03:06 pm by Laurent »
Laurent Gomila - SFML developer

 

anything