1
Graphics / Text is blurred
« on: February 29, 2012, 04:49:12 pm »Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Window;
using SFML.Graphics;
using System.IO;
using System.Diagnostics;
namespace SFML_Test3
{
static class Program
{
static RenderWindow renderWindow;
static void Main(string[] args)
{
renderWindow = new RenderWindow(new VideoMode(800, 500), "SFML 2", Styles.Default, new ContextSettings(32, 0, 16));
renderWindow.Show(true);
renderWindow.ShowMouseCursor(true);
renderWindow.SetFramerateLimit(60);
renderWindow.Closed += (s, e) => { Environment.Exit(0); };
renderWindow.Resized += (s, e) => { renderWindow.SetView(new View(new FloatRect(0, 0, e.Width, e.Height))); };
Font debugFont = new Font(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "visitor1.ttf"));
Text debugText1 = new Text("TEST1", debugFont, 10);
Text debugText2 = new Text("TEST2", debugFont, 20);
debugText2.Scale = new Vector2f(0.5f, 0.5f);
while (renderWindow.IsOpen())
{
renderWindow.DispatchEvents();
renderWindow.Clear();
//
debugText1.Position = new Vector2f(50, 50);
debugText2.Position = new Vector2f(50, 80);
renderWindow.Draw(debugText1);
renderWindow.Draw(debugText2);
//
renderWindow.Display();
}
}
}
}
Font used is this one:
http://www.dafont.com/visitor.font
there are 2 versions, obviously (from looking at the source) I am using visitor1
I'm getting similar results for all other fonts too.
EDIT:
I just noticed that changing: new ContextSettings(32, 0, 16);
to
new ContextSettings(32, 0, ); // 8 or lower
resolves the problem, the question remains... why ?
When I use (for example) Arial and antialiasing == 0, it's like you said, the first result looks better.
Does that mean that I shouldn't use antialiasing:16 or is it some kind of bug?