SFML community forums

Help => Graphics => Topic started by: Merad on February 18, 2015, 09:48:11 pm

Title: Text is very blurry
Post by: Merad on February 18, 2015, 09:48:11 pm
Pic: https://dl.dropboxusercontent.com/u/24553495/gc.png

The text I'm talking about is insize the Overview panel, the labels by each vertical line.  This screenshot was taken with the text set to arial font, default rendering style, and character size 8.  I'm guessing this might be because the view used for that window is rather large (it's showing the entire track, which is several hundred meters long), but what can I do to fix it?

Edit: I'm using SFML.net with C# if that makes a difference.
Title: Re: Text is very blurry
Post by: eXpl0it3r on February 18, 2015, 10:04:51 pm
If you draw a font and then zoom the view, the font will be enlarged with the anti-aliasing applied, thus getting a blurry text.
What you could do is make sure that you draw the font 1:1.

If that's not enough there's a thread somewhere on how to disable anti-aliasing for text.
Title: Re: Text is very blurry
Post by: Merad on February 18, 2015, 10:56:17 pm
What you could do is make sure that you draw the font 1:1.

I think I am already doing that?

My RenderWindows are drawing onto WinForms panels, so the main windows and the overview are separate RenderWindows.  All I do is set the size of the overview's view on creation and resize:

private void OverviewWindowOnResized(object sender, SizeEventArgs e)
{
  var ratio = (float)e.Height / e.Width;
  m_overviewView.Size =  new Vector2f(m_track.Dimensions.X, m_track.Dimensions.X * ratio);
}

And then the drawing:
m_overviewWindow.SetView(m_overviewView);
m_overviewWindow.Clear(Color.White);
m_track.DrawOverview(m_overviewWindow);
m_population.DrawOverview(m_overviewWindow);
m_overviewWindow.Display();