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

Author Topic: Font smoothing in SFML 1.6  (Read 2147 times)

0 Members and 1 Guest are viewing this topic.

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Font smoothing in SFML 1.6
« 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:

Code: [Select]

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.

Haikarainen

  • Guest
Re: Font smoothing in SFML 1.6
« Reply #1 on: September 11, 2011, 07:59:22 pm »
Quote from: "BlueMagic"
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:

Code: [Select]

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.

Code: [Select]
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

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Font smoothing in SFML 1.6
« Reply #2 on: September 11, 2011, 08:13:17 pm »
GetImage() doesn't take any arguments, not on 1.6 at least.