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

Author Topic: Text is very blurry  (Read 1671 times)

0 Members and 1 Guest are viewing this topic.

Merad

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Text is very blurry
« 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.
« Last Edit: February 18, 2015, 09:49:49 pm by Merad »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Text is very blurry
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Merad

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Text is very blurry
« Reply #2 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();