Extract embedded font license
.NET API Solution to detect the licensing information of a font.
Aspose.Font API Solution for .NET has a rich functionality to work with fonts. Conversion, glyph manipulations, loading and saving fonts, and many more.
Font is considered to be software, and as any software, to be used, it should be paid. Yes, there is a scope of free fonts but most of them are not. So to use a font and not to violate copyright you need to buy a license.
This page describes how to open font license on the example of the font of TrueType format. All the rest code snippets on how to use the solution are placed in the Aspose.Font-Documentation GitHub project. There you will find much more C# code examples. To see the license in a font along with many other enclosed information online, try our Font Metadata cross-platform application.
To extract embedded license we need:
Aspose.Font for .NET API which is a feature-rich, powerful and easy-to-use document manipulation and conversion API for C# platform.
Open the NuGet package manager, and search for Aspose.Font and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Font
Steps to detect whether the font includes licensing information using C#:
- Specify the font that needs to be checked.
- Detect the licensing information using the LicenseFlags Class.
C# Code for detecting licensing information in fonts
using Aspose.Font.Ttf;
//Font to check
TtfFont font;
LicenseFlags licenseFlags = null;
if (font.TtfTables.Os2Table != null)
{
licenseFlags = font.TtfTables.Os2Table.GetLicenseFlags();
}
if (licenseFlags == null || licenseFlags.FSTypeAbsent)
{
Console.WriteLine(string.Format("Font {0} has no embedded license restrictions", font.FontName));
}
else
{
if (licenseFlags.IsEditableEmbedding)
{
Console.WriteLine(
string.Format("Font {0} may be embedded, and may be temporarily loaded on other systems.", font.FontName)
+ " In addition, editing is permitted, including ability to format new text"
+ " using the embedded font, and changes may be saved.");
}
else if (licenseFlags.IsInstallableEmbedding)
{
Console.WriteLine(
string.Format("Font {0} may be embedded, and may be permanently installed", font.FontName)
+ " for use on a remote systems, or for use by other users.");
}
else if (licenseFlags.IsPreviewAndPrintEmbedding)
{
Console.WriteLine(
string.Format("Font {0} may be embedded, and may be temporarily loaded", font.FontName)
+ " on other systems for purposes of viewing or printing the document.");
}
else if (licenseFlags.IsRestrictedLicenseEmbedding)
{
Console.WriteLine(
string.Format("Font {0} must not be modified, embedded or exchanged in any manner", font.FontName)
+ " without first obtaining explicit permission of the legal owner.");
}
}
FAQ
1. What is a font license?
It is a document to declare what can be done with the font, usage restrictions, and allowances, and copyright.
2. Do you need to license fonts?
As any other software, fonts are protected under copyright and so they are licensed. Anyway, some licensed fonts can be used for commercial needs for free.
3. Can I use a font commercially?
Yes, fonts can be used commercially either paid or free. The license includes such type of information too.
4. How to check font license?
To see if the font includes license information online you can use Font Metadata app. There you will see such information as the License Description, License Info Url, and Copyright Notice. To get such information programmatically you need to use the properties of the LicenseFlag Class.