SFML community forums
Help => Graphics => Topic started by: Brendon on March 24, 2011, 08:26:28 pm
-
I've started to use SFML2 dotnet and had a beginner's question about how text is rendered.
When I draw small font sizes, it looks fine. But, when I draw a larger font size (font size 4), it renders blurrily:
(http://blendogames.com/dev/dev_text.jpg)
scratchString.DisplayedString = "Center";
scratchString.Scale = new Vector2(4, 4);
renderWindow.Draw(scratchString);
How does one correctly render large font sizes?
-
You must load the font with the correct size directly if you want to avoid the scaling ugliness.
-
In SFML1 the font constructor had a size parameter, but SFML2 doesn't seem to include that parameter.
SFML1:
new Font(string filename, uint charSize)
SFML2:
new Font(string filename)
-
Sorry I answered too quickly :)
In SFML 2 the solution is simpler: use CharacterSize instead of Scale.
-
Works perfectly. Thanks Laurent!
scratchString.DisplayedString = "Center";
scratchString.Size = 64;
renderWindow.Draw(scratchString);