SFML community forums
Help => Graphics => Topic started by: BlueMagic on September 11, 2011, 07:53:27 pm
-
Hey, I've been having troubles with fonts in SFML lately. I can't seem to properly disable the smoothing that SFML does by default.
There's nothing weird with my code. First I do this:
currentFont->LoadFromFile("test.ttf");
((sf::Image&)currentFont->GetImage()).SetSmooth(false);
and then I add some test text so I can try it out. No matter what the size of the font (and the text) is, most (and only one font worked correctly) of the fonts look ugly with smoothed edges. I want them to be pixelated since I'm going for that pixely-retro look.
Thanks a lot for reading.
-
Hey, I've been having troubles with fonts in SFML lately. I can't seem to properly disable the smoothing that SFML does by default.
There's nothing weird with my code. First I do this:
currentFont->LoadFromFile("test.ttf");
((sf::Image&)currentFont->GetImage()).SetSmooth(false);
and then I add some test text so I can try it out. No matter what the size of the font (and the text) is, most (and only one font worked correctly) of the fonts look ugly with smoothed edges. I want them to be pixelated since I'm going for that pixely-retro look.
Thanks a lot for reading.
You have to specify the size.
this->Text_Small.LoadFromFile("./data/smallfont.ttf");
((sf::Image&)this->Text_Small.GetImage(10)).SetSmooth(false);
That only disables smoothing on size 10. so you have to repeat the blabla.SetSmooth()blabla as many times as fontsizes youre using
-
GetImage() doesn't take any arguments, not on 1.6 at least.