The classSystem.Drawing.Font is not XML Serializable since it doesn’t have a default (empty) constructor.
Is there some work around or alternative way to serialize Font nevertheless?
The class System.Drawing.Font is not XML Serializable since it doesn’t have a default (empty)
Share
Edit: I updated the code according to Regent suggestion to use
FontConverter, while preserving the ability to use theSerializableFontas regularFont.Usage: When you have a
Fontproperty, declare it asSerializableFont. This will allow it to be serialized, while the implicit cast will handle the conversion for you.Instead of writing:
Write: