public static int ConvertToInt(FontStyle font)
 {
     if (font.Equals(FontStyles.Oblique))
     {
         return 1;
     }
     if (font.Equals(FontStyles.Italic))
     {
         return 2;
     }
     return 0;
 }
 /// <summary>
 /// Writes the attribute.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 /// <param name="defaultValue">The default value.</param>
 protected void WriteAttribute(string name, FontStyle value, FontStyle defaultValue)
 {
     if (this.settings.WriteDefaultValues || !value.Equals(defaultValue)) {
         this.writer.WriteAttributeString(name, value.Format());
     }
 }