How do I read and OTF font with Aspose.Font (.NET)

I’ve been searching high and low for code examples demonstrating the ability to load an OTF font, but all of the documents and examples that I’ve found seem to only show TTF. I already figured out how to do TTC, but OTF, I see nothing showing how to accomplish this.

I’m currently using a free trial version. My company won’t commit to purchasing a license until I can prove to them OTF is supported.

@nristoTaylor

OpenType Font format was added in the API as an extension of the TrueType Font format. For example, check the below example in the API documentation.

Furthermore, can you please share what operation you want to perform after loading the OTF font? Do you want to convert it? We will further share our feedback with you accordingly.

@nristoTaylor

Adding more to our pervious response, you can load OTF fonts in the same way, how we load TrueType fonts - using Font.Open(FontDefinition) method, where FontDefinition.FontType can be OTF or TTF. Return value must be casted to object of type Aspose.Font.Ttf.TtfFont.

But support for OTF fonts is weak. There are known problems with conversion of OTF fonts and in other areas. So, some operations will work with OTF fonts just how they work with TTF fonts, but some may meet problems. We definitely have plans to extend the support in this area and will improve the API in terms of loading, reading and converting the OTF Fonts. Please feel free to share your concerns with us.