Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aspose-com-gists/f35222e3fbe8cb8050e58bcb67c01089 to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/f35222e3fbe8cb8050e58bcb67c01089 to your computer and use it in GitHub Desktop.
Convert Type1 and Type3 fonts to TTF with .NET

Fonts Conversion Examples

These code snippets will help you convert Type1 and Type3 fonts to TrueType (TTF). With Aspose.Page for .NET library, it is quick and simple to convert Type3 fonts, contained in PostScript (PS) files, and Type 1 fonts, contained in either PS, PFA, or PFB files, to TTF.

Key Use Cases

  • How to convert Type1 fonts to TTF.
  • How to convert Type3 fonts to TTF.

How to Run Examples

  1. Make sure Aspose.Page for .NET library is referenced in your project. If you are going to use our library in a non-Windows OS, you should reference or install with NuGet another version of Aspose.Page for .NET. This version of the library doesn't require System.Drawing.Common package of the .NET platform.
  2. Copy the necessary code snippet from here to your project.
  3. Download temporary license and set it up as it is shown here.
  4. Execute it.

Restrictions

In unlicensing mode, Aspose.Page for the .NET library doesn't allow conversion of fonts. Set up a valid temporary or paid license in order to use font conversion.

Related Documentation

More about font conversion is in the tutorial Working with fonts chapter of the official documentation.

Related Resources

Requirements

  • .NET 6.0+, .NET Core, or .NET Framework
  • Aspose.Page for .NET library
Aspose.Page for .NET – Convert Fonts Examples
// Convert Type1 font from "*.ps", ".pfa" or ".pfb" file.
// Learn more: https://docs.aspose.com/page/net/type1-to-ttf/
//Create ne PsDocument object
PsDocument doc = new PsDocument();
//Convert Type1 font from the file 'Type1_Arial_Bold.ps' to TTF font in DataDir folder.
//Exstension of file can be ".pfa", ".pfb", ".ps" or something else. The main thing is that there is a font Type1 inside.
doc.ConvertType1FontToTTF(DataDir + "Type1_Arial_Bold.ps", OutputDir);
// Convert Type1 font from "*.ps" file.
// Learn more: https://docs.aspose.com/page/net/type3-to-ttf/
//Create ne PsDocument object
PsDocument doc = new PsDocument();
//Convert outline Type3 font from the file 'Type3_outline.ps' to TTF font in dataDir folder.
//Exstension of file can be ".ps" or something else. The main thing is that there is a font Type3 inside.
doc.ConvertType3FontToTTF(DataDir + "Type3_outline.ps", OutputDir);
//Convert bitmap Type3 font from the file 'Type3_bitmap.ps' to TTF font in DataDir folder.
doc.ConvertType3FontToTTF(DataDir + "Type3_bitmap.ps", OutputDir);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment