SFML community forums

Help => Graphics => Topic started by: kenpower on February 17, 2023, 01:50:52 pm

Title: Drawing text using when using a view causes bad aliasing
Post by: kenpower on February 17, 2023, 01:50:52 pm
Hi,

I'm drawing text into a window with a custom view. I'm using the view to zoom in/out. But my text is suffering terrible aliasing (thin horizontal lines are disappearing) when I zoom in. My guess is that the text is being draw on non-integer positions within the view.

What can be done to mitigate this?

Thanks

Title: Re: Drawing text using when using a view causes bad aliasing
Post by: eXpl0it3r on February 17, 2023, 06:16:03 pm
You really shouldn't be zooming in or out on text, instead you should adjust the text size accordingly and render the text on a separate unscaled view to the screen.
That then also allows you to ensure you're always rendering on integer positions.

Otherwise, there isn't too much you can do, as the rasterizer has to cut some information when zooming out and there's a good chance that sharp edges will visually suffer.