Convert Type3 font to TrueType | Java API Solution

Overview

This article explains how to convert Type3 font to TTF using Java. It covers the following topics.

Exploring Type 3 fonts and their role in PostScript

In the landscape of digital typography, Type 3 fonts represent a unique and versatile option, particularly within the PostScript page description language. While not as widely used as Type 1 fonts, Type 3 fonts offer distinct advantages and functionalities that can be beneficial in various design applications.

What are Type 3 fonts?

Type 3 fonts are a font format used in PostScript that allow for more flexibility than traditional outline fonts like Type 1. Unlike Type 1 fonts, which are strictly vector-based and defined by mathematical outlines, Type 3 fonts can incorporate bitmap images and other graphical elements directly into the font definition. This means that Type 3 fonts can include complex designs, making them suitable for creative and artistic applications. These fonts are described by pure PostScript code.

Key features of Type 3 fonts

  1. Flexibility: Type 3 fonts allow designers to include any kind of graphical representation within the font itself. This can include not only standard text characters but also intricate designs, logos, or illustrations, making them ideal for creative projects.

  2. Bitmap Support: One of the standout features of Type 3 fonts is their ability to contain bitmap images. This allows for the embedding of raster graphics directly into the font, which can be useful for decorative text or specialized graphic needs.

  3. Customizability: Designers can create Type 3 fonts with unique characteristics tailored to specific projects. This level of customization is appealing for branding, advertising, and artistic endeavors, where standard fonts may not suffice.

Type 3 fonts in PostScript

Type 3 fonts fit into the PostScript ecosystem by providing a means to include both text and graphic elements in the same font file. When creating a PostScript document, a designer can specify Type 3 fonts, allowing for creative uses that blend typography and imagery seamlessly.

In a PostScript file, commands can be issued to use a Type 3 font, which the PostScript interpreter then renders based on the defined characteristics of that font, whether it includes vector outlines, bitmaps, or other graphical components. This ability to combine text and images within a single font file opens up new avenues for creativity and expression in printed materials.

Applications of Type 3 fonts

While Type 3 fonts are less common than their Type 1 counterparts, they find their niche in specific applications:

Java How to convert Type3 font to TrueType

In order to convert a given Type3 font, the file containing it must contain either only that font or also some other PostScript code. The extension of the file can be any, not only PS, but must contain only PostScript code. Actually, that’s all you need for conversion.

So there are only two steps for converting Type3 font to TrueType in Java follows:

  1. Create new PsDocument object.
  2. Convert input Type3 font to TTF with the static method convertType3FontToTTF.

You can check the Type3 font to TTF conversion functionality online on our Type3 Converter web application.

Convert Type3 to TTF in Java

In the following Java code snippet we convert Type3 font to TrueType font:

 1// For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Java
 2
 3// The path to the documents directory.
 4String dataDir = getDataDir();
 5
 6//Create new PsDocument object
 7PsDocument doc = new PsDocument();
 8
 9//Convert Type3 font from the file 'Type3Font.ps' to TTF font in dataDir folder.
10//Exstension of file can be ".ps" or something else. The main thing is that there is only PostScript code inside.
11doc.convertType3FontToTTF(dataDir + "Type3Font.ps", dataDir);

See Convert Type3 to TTF in .NET and C++.

Evaluate conversion of Type3 font to TTF online via Convert Type3 font web application. You can convert Type3 font to TTF and dowload result in a few seconds.

You can download examples and data files from GitHub.

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.