Convert a TrueType font to WOFF with saveToFormat, and convert a CFF font to TrueType with convert to change its name before saving. The examples use Aspose.Font for Java.
The samples use montserrat-bold.ttf and 29645.cff, replacing the Montserrat Regular and CenturyGothic fonts in the documentation. Supply getDataDir() and getOutputDir() for your application. Input paths reference the sibling TTF and CFF directories; the output directory must exist and be writable.
The WOFF example closes its output stream with try-with-resources. The advanced example obtains a TtfFont, changes its name, and saves the resulting TTF. Outputs are TtfToWoff_out1.woff and CffToTtf_out.ttf. These examples demonstrate the two conversion paths shown here.
- Documentation – Aspose.Font for Java
- Product page – Aspose.Font for Java
- Free Support Forum – Aspose.Font
- Blog – Aspose.Font Product Family
- API Reference – Aspose.Font for Java
- Releases – Aspose.Font for Java
- JDK 8 or later and Maven for this example project
- Aspose.Font for Java 26.8