2
\$\begingroup\$

I am using Monogame 3.4 (I have held off upgrading to 3.5) and am on Windows 10. I'm drawing using the PointClamp setting (as suggested in this similar question).

Whenever I render text with DrawString(), the text is extremely antialiased, as shown below. However, any stretched textures I draw are NOT antialiased, and seem to use the PointClamp setting as expected.

Here are some examples of drawn text:

Example Example 2

How do I disable text antialiasing so that fonts don't blur?

EDIT:

It seems that changing some import settings in the .mgcb changes the quality of the AA? When "processorParam:TextureFormat=Color" is changed to "processorParam:TextureFormat=Compressed", it makes the AA more pronounced. The issue is still not solved, but I feel like the font import settings may have something to do with it. Here is the .mgcb

#begin DwellFont.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:TextureFormat=Color
/build:DwellFont.spritefont

EDIT 2

Since this question got flagged as a duplicate, let me explain. The other question I have already referenced above uses PointClamping. I already use PointClamping, and it works fine with the textures I render (they aren't antialiased). It does not, however, work with my fonts. Therefor, that other question isn't applicable. I'm wondering why that is.

\$\endgroup\$
  • 1
    \$\begingroup\$ The compression change you describe is probably not influencing antialiasing or texture filtering/interpolation. It's just storing the font texture in a compressed format that's prone to more errors & bleeding artifacts than an uncompressed texture. \$\endgroup\$ – DMGregory Nov 2 '16 at 2:25
  • 1
    \$\begingroup\$ @DMGregory Interesting, thanks. It seems to happen with whatever fonts I try. \$\endgroup\$ – Brady Welch Nov 2 '16 at 10:51
  • 1
    \$\begingroup\$ @BradyWelch apologies did not see the link, will remove my comment. Are you using fractional values in your position? May be related to this MonoGame Issue. \$\endgroup\$ – lozzajp Nov 2 '16 at 11:08
  • 1
    \$\begingroup\$ @lozzajp No worries (sorry for being rude, I've just been dealing with this issue for months now and it's driving me insane)! I've actually already tried casting positions to an integer and it didn't fix anything. I can try upgrading to the new version of Monogame as well to see if that fixes it, but I didn't read anything in their changelog that would suggest it's been fixed. \$\endgroup\$ – Brady Welch Nov 2 '16 at 11:39
  • 1
    \$\begingroup\$ Another question I saw a suggestion of trying TextureFormat=NoChange beyond that yes try the stable release of 3.5 and even give the latest development branch a go, if it is still not working try the community and possibly open an issue yourself on their github repo. \$\endgroup\$ – lozzajp Nov 2 '16 at 12:03
1
\$\begingroup\$

Basically you have to use the Font Texture feature, which allows you to create a texture with just about any content, as pixely or blurry as you like, and load it into a spritefont. Read more at: https://blogs.msdn.microsoft.com/shawnhar/2007/04/26/bitmap-fonts-in-xna/

Or just Google "XNA Font Texture".

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

I believe this could help you (quoting from Shawn Hargreaves' MSDN blog):

At this point you may be worrying that drawing an entire font into a bitmap by hand is not your idea of fun. And you’d be right. I wouldn’t enjoy it much either.

Fortunately, the kindly little gremlins who work at XNA CGP GSE Samples & Utilities, Inc, saw this problem coming and wrote a program to take care of it. This presents a user interface for selecting what TrueType font you want to use as a starting point.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.