Font is the set of graphical representations of symbols. The way a font looks depends on the font’s parameters such as type family, typeface, font proportions, etc. Working with fonts is important in interface development, design, or typography. How will your interface look depends on the font you choose, but also there are a lot of factors you need to take to stop on the right font. Not only do users pay attention to the readability of the texts but also search engines take them into account when forming search results.
Aspose.Font for .NET is a flexible and easy-to-use library to work with different font files. This API supports multiple font formats like TrueType, CFF, OpenType, EOT, WOFF, WOFF2, and Type1. It allows you to load fonts and provides their data structure information along with any glyph, encoding information for all the font types. End-users can get help through its rendering subsystem to render any desired glyph or text.
At a Glance
An overview of Aspose.Font for .NET API.
- Support Multiple Formats
- Load font documents from disc
- Load font files stream
- Read font information
- Read Glyphs and Metrics info
- Detect Latin Symbols
- Extract embedded licensing info
- Render text
- Save updated font files
- Convert fonts to a more suitable format
Aspose.Font for .NET supports all major platforms including.
Supported File Formats
Aspose.Font for .NET supports the following file formats :
- True Type Font: TTF
- Web Open Font Format: WOFF
- Input/Output WOFF2
- Embedded OpenType: EOT
- Compact Font Format: CFF
- Adobe Type 1 font: PFA, PFB, AFM, PFM
- True Type Collections: TTC
Advanced .NET Font API Features
Load, Extract and Save TrueType Font
Aspose.Font for .NET can easily load, extract and save different font formats. Here is just few lines of code for TrueType TTF.
Load, Extract and Save TTF - C#
//byte array to load Font from byte fontMemoryData = File.ReadAllBytes("directoryPath" + "Montserrat-Regular.ttf"); FontDefinition fd = new FontDefinition(FontType.TTF, new FontFileDefinition("ttf", new ByteContentStreamSource(fontMemoryData))); TtfFont ttfFont = Aspose.Font.Font.Open(fd) as TtfFont; //Work with data from just loaded TtfFont object //Save CffFont to disk ttfFont.Save("ouputDirectoryPath"+Montserrat-Regular_out.ttf);