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

Author Topic: [2.0] [Fixed] Text renders incorrectly  (Read 2140 times)

0 Members and 2 Guests are viewing this topic.

LittleCodingFox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://littlecodingfox.blogspot.com
[2.0] [Fixed] Text renders incorrectly
« on: April 05, 2013, 12:49:25 pm »
I'm doing some text rendering with this font, and on most computers it works well, but on my new work computer I get this instead: http://i46.tinypic.com/vcrmtf.png I'm using a nVidia 9600 video card.

As you can see the characters are obviously misaligned vertically. Any idea what might be causing this?
« Last Edit: April 05, 2013, 03:13:39 pm by LittleCodingFox »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [2.0] Text renders incorrectly
« Reply #1 on: April 05, 2013, 01:40:40 pm »
Have you tried the font outside a SFML program? Like in a text editor for example.
Laurent Gomila - SFML developer

LittleCodingFox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://littlecodingfox.blogspot.com
Re: [2.0] Text renders incorrectly
« Reply #2 on: April 05, 2013, 01:49:27 pm »
I tried it in Notepad++ and it renders fine

LittleCodingFox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • http://littlecodingfox.blogspot.com
Re: [2.0] Text renders incorrectly
« Reply #3 on: April 05, 2013, 03:13:25 pm »
I figured out the problem. I noticed that other text using the same font worked properly, so I tried moving the object that had the text in that screenshot. Imagine my surprise when I saw that the text would change its shape depending on the position it was being rendered!

So I tried forcing the coordinates to not have any decimal coordinates (convert to int and then float again) and now it works flawlessly!

Rather odd if you ask me. Not sure if you had anyone else with the same problem, but this might be worth investigating, and an easy workaround is simply converting the coordinates of the position to draw in!