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

Author Topic: sf::Text Rendering problem  (Read 1538 times)

0 Members and 2 Guests are viewing this topic.

fbvims

  • Newbie
  • *
  • Posts: 4
    • View Profile
sf::Text Rendering problem
« on: December 29, 2014, 10:56:14 am »
Hi,

I have a strange Text rendering problem with SFML 2.2 on Windows 7 64bits.

The fonts are garbled whatever font settings I choose. Same with SFML 2.0.

Here is the minimal code to reproduce the problem.

See attachements for the results (standard OpenGL example included too).

Did anybody see this before ?

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "Draw Text");
       
    sf::Font font;

    if(font.loadFromFile("arial.ttf"))
    {
        sf::Text text("Foo", font, 50);

        window.clear();
        window.draw(text);
        window.display();
        Sleep(5000);
     }
       
        return 0;
}

NOTE: I use the static libs built with Visual Studio 2010.
No other problems noticed so far.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Text Rendering problem
« Reply #1 on: December 29, 2014, 11:13:50 am »
Are you using SFML 32 bits or 64 bits?

Are your graphics drivers up-to-date? What's your graphics card?
Laurent Gomila - SFML developer

fbvims

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: sf::Text Rendering problem
« Reply #2 on: December 29, 2014, 11:19:23 am »
I use the 64bits version.
With recent NVIDIA drivers (340.62).
(I use various cards: GT 520, GTX 780 Ti and GTX 980)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Text Rendering problem
« Reply #3 on: December 29, 2014, 11:21:48 am »
You can try the 32 bits version, just in case ;)
Laurent Gomila - SFML developer

fbvims

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: sf::Text Rendering problem
« Reply #4 on: December 29, 2014, 11:38:36 am »
Yes, the problem persists with 32 bits version.
(Both static and dynamic builds).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: sf::Text Rendering problem
« Reply #5 on: December 29, 2014, 11:51:27 am »
I guess the next step would be to throw out SFML and test text rendering with freetype directly. Maybe you can find somewhere some simple example?
Did you try other OpenGL based games (which use freetype)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

fbvims

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: sf::Text Rendering problem
« Reply #6 on: December 29, 2014, 12:05:25 pm »
NeHe FreeType Fonts in OpenGL tutorial  works fine here.
I'll dig on the FreeType side however.