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

Author Topic: Font blurry?  (Read 6092 times)

0 Members and 1 Guest are viewing this topic.

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« on: December 10, 2009, 10:45:43 pm »
When I draw some text, it comes out blurry...

I'd really like to know what's causing this.

Just in case...
Windows XP SP3 Home 32-bit
Intel Pentium 4 1.70GHz
512MB of RAM
Intel 82845G/GL/GE/PE/GV Graphics (64MB)

SFML 1.5 in MSVC++ 2008

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #1 on: December 10, 2009, 10:47:31 pm »
Can we see the code?

What about the SDK samples, are they blurry too?
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #2 on: December 10, 2009, 10:56:56 pm »
Code: [Select]
#include <iostream>
#include "Window.hpp"
#include "GUIManager.hpp"
#include "GUILabel.hpp"
#include "GUIButton.hpp"

#define WINDOW Window::getInstance()->rw

std::string itoaCPP(int val, unsigned int base = 10, unsigned int minlen = 16, char fill = 0); // custom function - int to str

int main()
{
    sf::Clock clock;
    int fps = 0;
    int frame = 0;
std::string fpsStr;
GUILabel* fpsLabel = new GUILabel(3, 3, fpsStr);
GUIButton* btn = new GUIButton(100, 100, "data/tile1.png");
GUIManager::getInstance()->addElement(fpsLabel);
GUIManager::getInstance()->addElement(btn);

    while (WINDOW->IsOpened())
    {
        sf::Event Event;
        while (WINDOW->GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                WINDOW->Close();
        }

        GUIManager::getInstance()->update(Event);

fpsStr = "FPS: " + itoaCPP(fps, 10, 8, '0');
fpsLabel->setText(fpsStr);

        WINDOW->Clear(sf::Color(154, 206, 235));

        GUIManager::getInstance()->draw();

        WINDOW->Display();

        if (clock.GetElapsedTime() >= 1.f)
        {
        fps = frame;
        frame = 0;
        clock.Reset();
        }
        frame++;
    }
}

I never tested the examples, will do now. No project, too lazy. :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #3 on: December 10, 2009, 10:59:50 pm »
The code showing the sf::Font and sf::String loading / drawing would be more relevant ;)
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #4 on: December 10, 2009, 11:07:51 pm »
Sorry, forgot about that. :P

Code: [Select]
void GUILabel::draw()
{
if (getVisible())
{
Window::getInstance()->rw->Draw(*getText());
}
}


GUILabel inherits:
Code: [Select]
sf::String* getText() { return m_text; }
void setText(std::string val) { m_text = new sf::String(val); }

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #5 on: December 10, 2009, 11:13:22 pm »
And you use the default built-in font? What's the character size of your string?
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #6 on: December 10, 2009, 11:18:19 pm »
Default font and size, different fonts and sizes didn't change output.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #7 on: December 10, 2009, 11:26:42 pm »
Ok... What about the samples?
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #8 on: December 10, 2009, 11:37:25 pm »
I didn't try them, I'm too lazy to set it up... Why aren't they full projects anyways?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #9 on: December 10, 2009, 11:44:56 pm »
You have nothing to setup, just run the executables in <sfml-sdk>/samples/bin.
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #10 on: December 10, 2009, 11:55:02 pm »

Doesn't look normal. :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #11 on: December 11, 2009, 12:08:42 am »
Are your graphics drivers up to date?

Quote
Intel 82845G/GL/GE/PE/GV Graphics (64MB)

Looks like a really crappy graphics card, isn't it?
Laurent Gomila - SFML developer

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #12 on: December 11, 2009, 12:24:01 am »
Yes its crappy, its not even a card. It's built-in (chip). I'm actually unsure whether the drivers are up to date. It should still work, though... I've only had this problem with SFML.

You know, this is the first time I found the drivers on Intel's site, crappy system they have. :/

Reinstalling drivers...

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
Font blurry?
« Reply #13 on: December 11, 2009, 12:40:47 am »
Found the problem, in my OpenGL settings, it was forcing texture compression! Turned it off and it was fine. :)

Thanks for your time.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font blurry?
« Reply #14 on: December 11, 2009, 08:21:57 am »
Great :)
Laurent Gomila - SFML developer