SFML community forums
Help => Graphics => Topic started by: LittleCodingFox on April 05, 2013, 12:49:25 pm
-
I'm doing some text rendering with this font (http://www.mediafire.com/?5e4bezwix25031f), and on most computers it works well, but on my new work computer I get this instead: http://i46.tinypic.com/vcrmtf.png (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?
-
Have you tried the font outside a SFML program? Like in a text editor for example.
-
I tried it in Notepad++ and it renders fine
-
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!