SFML community forums
Help => General => Topic started by: N_K on March 16, 2012, 11:19:01 pm
-
Hello all.
I would like to disable font smoothing in my app, since the font I'm using looks extremely ugly (and completely unreadeble below size 12) right now.
I did a search, and the only useful thread I found was this (http://www.sfml-dev.org/forum/viewtopic.php?p=35073).
This code snippet was posted in there:
Font* f = MyCustomLoadFontMethod();
((Image&)f->GetImage(30U)).SetSmooth(false);
However, it looks like only a reference code to me, and since I'm not that experienced, I simply have no idea what to do with it.
Could somebody post a sample implementation, please?
Thank you.
-
SFML 1.6 or 2?
-
1.6
(Does SFML 2 have a built-in option to disable this?)
-
1.6
So the correct code is
// font is your sf::Font instance
((sf::Image&)font.GetImage()).SetSmooth(false);
Does SFML 2 have a built-in option to disable this?
No.
-
Not extremely important, but I would use const_cast to make the intention more expressive. When looking at the code, one directly knows that only const is removed and no other conversion is performed.