I am using MonoGame to port my XNA Windows Phone app to iPhone. All is well, except that my fonts look distorted/smudged on the iPhone.

enter image description here

Turns out this is due to the way that MonoGame builds the content fonts. They basically let XNA compress them, then MonoGame uncompresses them and re-compresses them again in PVRTC, causing the distortion. The MonoGame team is aware of that, however no solution has come out from them, yet. Other users have suggested using the Nuclex spritefont processor to bypass compression, however I am unable to do that since I get the following error on build:

Error   1   Building content threw Exception: Font could not be found
   at Nuclex.Fonts.Content.FreeTypeManager.OpenWindowsFont(String searchedFaceName, FontDescriptionStyle style)
   at Nuclex.Fonts.Content.FreeTypeManager.OpenFont(String pathOrFaceName, FontDescriptionStyle style)
   at Nuclex.Fonts.Content.FreeTypeFontProcessor..ctor(FontDescription fontDescription, FontHinter hinter)
   at Nuclex.Fonts.Content.NuclexSpriteFontDescriptionProcessor.Process(FontDescription input, ContentProcessorContext context)
   at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process(Object input, ContentProcessorContext context)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
   at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates, Dictionary`2& dependencyTimestamps, KeyValuePair`2[]& warnings)   c:\users\ramsay\documents\visual studio 2010\Projects\MonogameContent\MonogameContent\MonogameContentContent\BoldFont.spritefont    MonogameContent

The author of the Nuclex framework explains the error]

There's no well-defined API for looking up the font names in Windows, so I'm checking the names embedded in the *.ttf files in the Fonts directory to find "Courier New" with the appropriate style flags.

So am now I have no idea how to fix this problem, and am looking for any advice. It's impossible to release an app with all the text looking smudged. However other MonoGame iOS apps are out there with undistorted text, so I am sure there is a solution, but I could not find it anywhere.

  • \$\begingroup\$ Can you please edit your post to include all the relevant details of your question here on GDSE. \$\endgroup\$ Commented Dec 13, 2013 at 0:54
  • \$\begingroup\$ @AndrewRussell I expanded the post a bit. \$\endgroup\$
    – user26471
    Commented Dec 13, 2013 at 4:55
  • \$\begingroup\$ @AndrewRussell It seems that Nuclex has trouble loading .otf(opentype) fonts. The Nuclex author advices me to specify in the full path to font, but I cant figure out how and where to do that. As a test, i tried placing this in the <FontName> field 'C:\Windows\Fonts\Calibri' but it didnt work. \$\endgroup\$
    – user26471
    Commented Dec 23, 2013 at 7:10
  • \$\begingroup\$ The path for Calibri is usually C:\Windows\Fonts\Calibri.ttf (whereas, say, Calibri Bold is calibrib.ttf). Of course, it's worth pointing out that you probably don't have a licence to redistribute the Calibri font, even as a bitmap font. \$\endgroup\$ Commented Dec 30, 2013 at 7:40


You must log in to answer this question.

Browse other questions tagged .