Convert EOT to WOFF or WOFF2 in C#.

EOT or Embedded Open Type fonts are popularly used on the web as they can be compressed to minimize the size. Likewise, WOFF (Web Open Font Format) is also popular because it enables sites to load faster while using less bandwidth. In some scenarios, you may need to convert an EOT font to WOFF format. Accordingly, this article explains how to convert an EOT font to WOFF or WOFF2 format programmatically in C#.

  1. EOT to WOFF or WOFF2 Converter - C# API Installation
  2. Convert EOT to WOFF Font in C#
  3. Convert EOT to WOFF2 Font in C#

EOT to WOFF or WOFF2 Converter - C# API Installation

Aspose.Font for .NET can be used to convert or manipulate different kinds of fonts and encodings. You can install the API by downloading its reference DLL files from the Downloads page or using the following NuGet installation command:

PM> Install-Package Aspose.Font

Convert EOT to WOFF Font in C#

You can convert an EOT font WOFF format by following the steps below:

  1. Create an instance of FontDefinition class.
  2. Open the font file and set output settings.
  3. Convert EOT to WOFF font format.

The sample code below explains how to convert an EOT font to WOFF format in C#:

Convert EOT to WOFF2 Font in C#

Please follow the steps below to convert EOT to WOFF2 font in C#:

  1. Initialize an object of FontFileDefinition class.
  2. Open the font with the created definition.
  3. Convert EOT font to WOFF2 font using SaveToFormat() method.

The code snippet below shows how to convert EOT to WOFF2 programmatically in C#:

Get a Free License

You can test the API without any evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have explored how to convert an EOT font to WOFF or WOFF2 font programmatically in C#. Furthermore, the documentation section contains different chapters. Please feel free to write to us at forum in case of any queries.

See Also