public static void Save(FontContent content, BinaryWriter writer)
 {
     writer.Write(content.Name);
     writer.Write(content.InverseSizeInTexels);
     writer.Write(content.Characters.Count);
     foreach (var pair in content.Characters)
     {
         writer.Write(pair.Key);
         writer.Write(pair.Value.SourceMinimum.X);
         writer.Write(pair.Value.SourceMinimum.Y);
         writer.Write(pair.Value.SourceSpan.X);
         writer.Write(pair.Value.SourceSpan.Y);
         writer.Write(pair.Value.Bearing.X);
         writer.Write(pair.Value.Bearing.Y);
         writer.Write(pair.Value.Advance);
         writer.Write(pair.Value.DistanceScale);
     }
     writer.Write(content.kerning.Count);
     foreach (var pair in content.kerning)
     {
         writer.Write(pair.Key.A);
         writer.Write(pair.Key.B);
         writer.Write(pair.Value);
     }
     Texture2DIO.Save(content.Atlas, writer);
 }
        public static void Save(IContent content, BinaryWriter writer)
        {
            switch (content.ContentType)
            {
            case ContentType.Font:
                FontIO.Save((FontContent)content, writer);
                return;

            case ContentType.Mesh:
                MeshIO.Save((MeshContent)content, writer);
                return;

            case ContentType.Image:
                Texture2DIO.Save((Texture2DContent)content, writer);
                return;
            }
            throw new ArgumentException("Given content type cannot be saved; no archiver is specified.");
        }