(Updated) LocalizationPipeline not working with the MonoGame Pipeline tool

In my XNA project I used a custom font processor from the LocalizationPipeline example(http://msdn.microsoft.com/en-us/library/ff966426.aspx#ID4EEB) to generate sprite fonts that contain only characters used in the game.

Now as I am trying to port my game to iOS, I followed the MonoGame Pipeline Tool tutorial (http://www.monogame.net/documentation/?page=Using_The_Pipeline_Tool) in hope of building the correct fonts for iOS. But it turned out not working.

It seems that namespaces like MonoGame.Framework.Content.Pipeline.Graphics and MonoGame.Framework.Content.Pipeline.Processors don’t exist, and thus lead to missing references like System.ComponentModel, FontDescription and SpriteFontContent.

How should I solve this problem? Or is there a better way to make localized fonts?

I tried reverting all using statements back to “Microsoft.Xna.**” and adding MonoGame.Framework.Windows to LocalizationPipeline’s references, and most errors were gone. Not sure if that fixed the issue though…

There is only one error now:
“Error 1 XML “Type” attribute is invalid. Expecting a subclass of Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription, but XML contains LocalizationPipeline.LocalizedFontDescription.”

It points to a .spritefont file. Inside that file there is one line:
<
Asset Type=“LocalizationPipeline.LocalizedFontDescription”>

And the “LocalizedFontProcessor” option doesn’t show up on the “Content Processor” box on the “Properties” window.
Now I’m really stuck where I am…

1 Like

OK I just figured it out. Here is how:

  1. Include in your solution the LocalizationPipeline project from the example

  2. Don’t change any references in the project

  3. Inside the LocalizationProcessor class, change the last “return” line to the one below:
    return context.Convert<FontDescription, SpriteFontContent>(input, “MGSpriteFontDescriptionProcessor”);

  4. Change the content processor for sprite fonts to “Localized Font Processor” and edit the sprite fonts as shown in the example

  5. Build the project and copy the .xnb font files to the content folder of your iOS MonoGame project.

That’s it! =)

Your post helped me!
Thanks, greyp!

Just one detail to add. the return line in step 3 should be like this:
return context.Convert < LocalizedFontDescription,SpriteFontContent>(input, “MGSpriteFontDescriptionProcessor”);

I hope more people find this thread

Haha, I’m glad you found it helpful! =)