Font Subsetting | Aspose.Font API Solution

What is font subsetting

Font subsetting is a process of taking specific characters from a font file. These characters though may be represented by a few glyphs. We will explain this moment further.

As it was told in the article about glyphs, font file includes as it called glyphsets. Their size varies dramatically and can be more than 5000 glyphs large. With subsetting you can create a file from only a few of them.

Why would you need to create a subset?

Let’s describe situations when subsetting would give you some benefit.

A simplified image of font subset

So the logo made in the subset of Dancing Script subset would look like this.

Logo from the glyphs of the generated subset

Subset web font

Web fonts consist of two important parts. They are characters (letters, numbers, punctuation) and Open Type features. The characters are placed in specific blocks relying on their functionality or language. Each of them has its own code(Unicode) mapped to a hex number. The Open Type features refer more to glyphs (variations of these characters).

Web font is one of the formats created especially for web projects, pages, sites, etc. It is aimed to make the text render properly in browsers and shorten page weight. You can learn more about WOFF and WOFF2 fonts from the article that tells about font formats.

Some also mention such terms as HTML font when talking about web fonts. This term refers to having one or more fallback options in case your font is not able to be rendered in some browser. HTML web font uses a web font installed on the user’s device as a fallback.

When talking about web fonts subsetting may have another advantages:

How to create a font subset with Aspose?

There are many ways to create a font subset. Some are programmatic ways, and some are just desktop or online applications.

Font subsetter cross-platform application

As an expert in managing fonts among the variety of different useful solutions Aspose.Font has also a cross-platform application that can help you to create a subset from your font.

The functionality is pretty simple. With it, you can combine glyphs of a few font files into a single one, or just make a much smaller, clearer file. You can pick out lower letters, numbers, punctuation, or type in the needed characters. It supports TTF, WOFF, EOT, CFF and Type 1 formats.

Let’s imagine we want to have our logo made of letters from the Abel Regular font. Its file is not that big, just 35 kb. and contains only 259 glyphs but yet we still want to make it as small as possible.

Picking needed characters from a font

After loading the font from the device or holder, it is possible to choose the needed characters. We need just 9 of them for our logo.

If needed there are a few buttons to make the process faster so you could choose upper or lower letters, numbers, mathematical symbols, or punctuation in one click.

Subsetting options of the application

In a moment you will be able to download the result. In our case, the generated font file is 2 kb.-large. So we’ve got the 15 times smaller file. Let’s compare the two documents using Viewer application

Comparison of two font files

As you may notice, the number of glyphs of the generated file is 10 and not 9 as we needed for our logo. The answer to this inconsistency is in the aforementioned thesis that one character may be represented by a few glyphs. So apparently one of the letters or the dot symbol has another variation of its look.

So that is obvious that with a much bigger file, you can get much more notable results. It somehow seems as useful as compressing the content(text files, images) with archives, but in comparison to compression, the quality of the characters of the subset does not change a bit.

Licensing limitations associated with font subsetting

When it comes to subsetting fonts, it is crucial to be aware of the licensing limitations associated with font usage. Font licensing terms may vary depending on the font foundry or designer. Let’s take a look at common considerations regarding licensing limitations when subsetting fonts:

The article here described one of the many applications for managing fonts. To see what else we can offer for such a purpose, go to Font Applications where you can find online converters, viewers, mergers, different generators, and many more.

Have any questions about Aspose.Font?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.