Hey guys! It has been a while since I have been around on the forum. But now I'm back with a question:
I recently have been developing stuff under Linux. When I was working with Fonts, I noticed that the font size isn't accurate; I had to move the font to achieve what I wanted. Then I compiled the same code under Windows and It looked weird, because the font size was right. I also noticed that this doesn't happen with every font.
Example:
I compiled the following code under both operating systems(I used the font
facile sans):
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(500, 500), "Example");
sf::Font font;
font.loadFromFile("font.ttf");
sf::Text text;
text.setFont(font);
text.setPosition(0, 0);
text.setCharacterSize(84);
text.setString("Text");
text.setColor(sf::Color::Black);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::White);
window.draw(text);
window.display();
}
return 0;
}
This is how it looks under Linux:
Under Windows:
Does anyone know why this happens and how to fix it?
I appreciate any help