CFF fonts are also known as Compact Font Format. These files can include different fonts as a single container. Whereas, the TTF fonts are popular as they ensure the highest quality display and printing without depending on the resolution. Therefore, you may need to convert a CFF file to TTF format in some scenarios. Following such requirements, this article covers how to convert a CFF file to TTF format programmatically in C#.
CFF to TTF Converter - C# API Installation
Aspose.Font for .NET supports working with different font types, glyphs, and encodings. It lets you extract font information, convert different types of fonts and many other features supported by the API. Simply configure the API by downloading the DLL file from New Releases or install it from NuGet gallery with the following command:
PM> Install-Package Aspose.Font
How to Convert CFF to TTF in C#
You can convert a CFF font to TTF format with the following steps:
- Create font file definition.
- Load the input font with font replacement and other data.
- Convert CFF to TTF font.
The following section further elaborates on how to convert CFF to TTF in C# by following these steps.
Convert CFF to TTF in C#
You need to follow the steps below to convert CFF to TTF font in C#:
- Create a font file definition object with FontFileDefinition class.
- Load the input font file with font replacement and other relevant data.
- Convert CFF font to TTF format with SaveToFormat() method.
The code snippet below demonstrates how to convert CFF to TTF programmatically in C#:
Get a Free License
You may request a free temporary license to evaluate the API to its full capacity.
Conclusion
In this article, you have learned how to convert CFF to TTF font programmatically in C#. Moreover, you may learn about other features of the API by visiting the documentation section. In case you need to discuss any of your concerns or queries, please write to us at forum.