New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sf::Font::SetSmooth() #526
Comments
What version of SFML are you using? If you are using 2.1 I recommend switching to the latest source, because of this fix. It has been added recently and improves text rendering quiet a bit. |
@Foaly I'm using the github source, downloaded a week ago. Thanks for the help; |
Could you provide the font that you're using, as well as a code sample (especially the text) which looks blurry? |
Files: The code's slightly long due to a peculiarity found while preparing the sample.
DrawShadowText() is just a function that draws a basic outline on the text just to see the blur clearer. You can comment out it's contents if you'd rather check without the outline. The peculiar thing I've noticed while preparing this sample, is that The only difference between the two is that As you can see, |
Hi, |
@kimci86 Nice, that solves it! Thanks! So I guess this wasn't a font problem. It'd be nice though if the thing about interpoloation could be stated in the comments of |
That's right, it should be documented. By the way it's a more complex issue, there are many other things that could produce this artifact: the view, the size of the window, etc. I've tried to solve it by many ways, but it seems that it's unavoidable. Rounding coordinates automatically would produce other (worse) problems. |
I can add a note to |
Yes, I think there are too many functions involved to put a note there. It should be done either in the tutorial, or in the general description of the sf::Transformable and sf::View classes. |
I think it would also be helpful to mention it in the tutorial. |
There are a lot of use cases where this scenario (interpolating pixels) is a feature, namely when you need smooth transitions. Consider an object that is being scaled or rotated: Without interpolation, the transition would look very discrete and blocky. Let alone the fact that a simple rounding of the position will only fix the most simple cases: As stated above, all other transforms and the whole view has to be taken into account. There have been several forum threads on the topic: |
I clarified this issue in the documentation, see commit e074b67. |
I'm realising for different fonts, font textures give a blurry touch that I'd rather head away from.
Here's a past thread that also proposes sf::Font::SetSmooth(), saying this is due to the default smoothing of fonts.
http://en.sfml-dev.org/forums/index.php?topic=5346.0
If the visual look of a font is different for each font, I think it's justifiable to say that having sf::Font::SetSmooth() would give users a clean convenient option to manage this themselves and their own fonts.
Example)
I'm currently working on a game for a Japanese audience and all the japanese fonts I'm using appear just blurry.
The text inside the red square show the blur clearly, especially the 1st and 3rd lines; I'm doing nothing special, just loading the font from the file (.ttf) and attaching it to an sf::Text.
The text was updated successfully, but these errors were encountered: