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

Author Topic: 2.0 RC sf::Text bug  (Read 4200 times)

0 Members and 1 Guest are viewing this topic.

Paki Programmer

  • Newbie
  • *
  • Posts: 31
    • View Profile
2.0 RC sf::Text bug
« on: May 03, 2012, 12:06:43 am »
When using sf::Text, there seems to be a bug where the letters of the string seem to be surrounded by a light blue outline. I took a screen print to show you what i mean. Any clues why this is happening or how to fix it? Or is it really just a bug in the API?



[attachment deleted by admin]

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: 2.0 RC sf::Text bug
« Reply #1 on: May 03, 2012, 01:38:40 am »
It's a known bug, there is a topic from yesterday about that :
http://en.sfml-dev.org/forums/index.php?topic=7787.0

Dunno if it's in the tracker but it assume it is

Note that it doesn't always appears (I have no idea about what is causing this)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: 2.0 RC sf::Text bug
« Reply #2 on: May 03, 2012, 07:57:53 am »
Yes, it's a known bug but there's no issue in the tracker.

Could you please post a complete and minimal code that reproduces the problem?
Laurent Gomila - SFML developer

Paki Programmer

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: 2.0 RC sf::Text bug
« Reply #3 on: May 04, 2012, 01:02:53 am »
Here is the code:


Code: [Select]

void Game::g_About()
{
sf::Text a_Title;
a_Title.setCharacterSize(75);
a_Title.setString("ABOUT");
a_Title.setPosition((SCREEN_W/4), 50);

sf::Text info;
info.setCharacterSize(M_TEXT_SIZE);
info.setString("This product was made and developed \nby Devil Theory Entertainment");
info.setPosition((SCREEN_W/5), (SCREEN_H/3));

sf::Text copyright;
copyright.setCharacterSize(25);
copyright.setString("Copyright 2012...All rights reserved.");
copyright.setPosition((SCREEN_W/5), 500);

sf::Text esc;
esc.setCharacterSize(20);
esc.setString("ESC - Go back to main menu");
esc.setPosition(0, (SCREEN_H - (esc.getCharacterSize() + 10)));

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
this -> game_state = mainmenu;
}

this -> window -> clear();
this -> window -> draw(a_Title);
this -> window -> draw(info);
this -> window -> draw(copyright);
this -> window -> draw(esc);
this -> window -> display();
}


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: 2.0 RC sf::Text bug
« Reply #4 on: May 04, 2012, 07:53:35 am »
Thanks, but if I say complete and minimal it's not just for fun ;)
Laurent Gomila - SFML developer

Paki Programmer

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: 2.0 RC sf::Text bug
« Reply #5 on: May 04, 2012, 12:29:58 pm »
I thought that's all you would need that's why lol ill post the entire code when I get home

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: 2.0 RC sf::Text bug
« Reply #6 on: May 04, 2012, 01:24:22 pm »
Laurent Gomila - SFML developer

Paki Programmer

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: 2.0 RC sf::Text bug
« Reply #7 on: May 05, 2012, 12:33:16 am »
Ok, so i managed to recreate the bug within a simple little program. The problem seems to be when you set the size of the text past a certain number the blue lines begin to show up. Here's the code:



#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow *window = new sf::RenderWindow(sf::VideoMode(800, 600), "Text Bug");

        sf::Text text;
        text.setCharacterSize(75);
        text.setString("This is a test string");
        text.setPosition(100, 300);

        while (window -> isOpen())
        {
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                {
                        window -> close();
                }

                window -> clear();
                window -> draw(text);
                window -> display();
        }

        return 0;
}

 

Ran this on Windows 7 64bit, SFML 2.0 RC, and Visual Studio 2010.

Another note that I discovered while attempting to recreate the bug; if you don't make sf::RenderWindow() a pointer like I did in the above code, then the program will crash when you close the window. This is also caused by sf::Text for some reason. 

[attachment deleted by admin]
« Last Edit: May 05, 2012, 09:49:44 am by Laurent »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: 2.0 RC sf::Text bug
« Reply #8 on: May 05, 2012, 09:52:27 am »
Thanks a lot :)

Quote
if you don't make sf::RenderWindow() a pointer like I did in the above code, then the program will crash when you close the window
It's a known bug (see the issue tracker).
And you didn't solve it by making the window a pointer, you just avoided it by not destroying the window (so you turned the bug into a memory leak instead).
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: 2.0 RC sf::Text bug
« Reply #9 on: May 05, 2012, 10:31:12 am »
Unfortunately I can't reproduce the bug with this code :(

What's your graphics card?
Laurent Gomila - SFML developer

Paki Programmer

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: 2.0 RC sf::Text bug
« Reply #10 on: May 06, 2012, 04:20:19 pm »
ATI Radeon HD 3200 Graphics