Hello everyone!
I've got problem with displaying
sf::Text correctly. Below is the code I use:
// Load font in OnInit() and create text.
sf::Font * font = new sf::Font();
if (!font->loadFromFile(path)) // loads courier new
{
// some code
}
sf::Text text = sf::Text("A+", *font, 18);
text.setColor(sf::Color::Red);
text.setOrigin(0.f, 0.f);
// ...
// Draw text in Draw()
_window.draw(text);
// ...
Provided code is just an example that contains most important parts (I store texture pointer correctly etc, so no worries).
The result is strange, because the text has strange top margin (it's not drawn exactly at top left corner, or is it?). Is it font's feature or I do something wrong? I've tried "Arial" and there was similar behaviour.
See the attachment for visual view.