EOT to WOFF or WOFF2 in Java

EOT fonts are a compact form of Open Type Fonts as they are embedded on web pages. While the WOFF fonts are compressed fonts that enable faster downloads of your content. In certain cases, you might want to convert an EOT file to WOFF or WOFF2 format. Following such scenarios, this article covers how to convert EOT to WOFF or WOFF2 programmatically in Java.

  1. EOT to WOFF or WOFF2 Converter - Java API Configuration
  2. Convert EOT to WOFF in Java
  3. Convert EOT to WOFF2 in Java

EOT to WOFF or WOFF2 Converter - Java API Configuration

Aspose.Font for Java is developed to work with different kinds of fonts. You can quickly configure the API by accessing the reference JAR files from the downloads section or pasting the details below in the pom.xml file of your application.

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://releases.aspose.com/java/repo/</url>
</repository> 
<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-font</artifactId>
    <version>22.10</version>
</dependency>

Convert EOT to WOFF in Java

We can convert an EOT font to WOFF or WOFF2 format with the following steps:

  1. Initialize an object of FontDefinition class.
  2. Create a Font class object to load the source font.
  3. Convert EOT to WOFF font.

The following code sample demonstrates how to convert EOT to WOFF in Java.

Convert EOT to WOFF2 in Java

You need to follow the steps below to convert EOT to WOFF or WOFF2 true type font file:

  1. Create an instance of the FontFileDefinition class.
  2. Access the source font file.
  3. Convert the EOT font to WOFF2 format using the saveToFormat() method.

The following code snippet elaborates on how to convert EOT to WOFF2 font programmatically in Java.

Get a Free License

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

Conclusion

In this article, you have learned how to convert EOT to WOFF or WOFF2 fonts programmatically in Java. Moreover, you can learn different other features of the API under the documentation section. In case of any concerns, please feel free to let us know via forum.

See Also