Detect embedded licensing information

Powerful C++ API Solution to detect the licensing information of a font. Uncover Hidden Value with Aspose.Font for C++: Extract embedded licensing information with Ease!

 

Unlock the power of licensing information extraction! Our cutting-edge C++ API solution will help you extract embedded licensing information easily. It uses advanced algorithms to extract licensing information, ensuring you have the most reliable data. Whether it is embedded in documents, media files, or software, our API supports a wide range of file formats. Whether you're a startup or a large enterprise, our API scales to meet your licensing information extraction needs. Built with C++ for seamless integration, our API can be easily incorporated into your existing software applications and workflows. Don't let embedded licensing information remain hidden and underutilized. Empower your licensing management and intellectual property protection efforts with our C++ API solution. Get a free trial to make sure that Aspose.Font is the tool you need.

It’s important to remember that fonts are considered software, and as such, must be paid for to be used legally. While there are some free fonts available, most are not. To ensure that you are using a font in compliance with copyright laws, it is necessary to purchase a license.

Font licenses are required to legally use a font in a specific manner, such as on a website, in print, or in software. Without a proper license, using a font in certain ways may violate the rights of the font's creator or owner. A font license defines the terms and conditions under which the font can be used. Font licensing restrictions can vary. There are a few options:

  • The font may be embedded and temporarily loaded on other systems. It allows editing, including the formatting of new text with the embedded font, and any changes can be saved.

  • The font may be embedded and permanently installed for use on remote systems or by other users.

  • The font may be embedded and temporarily loaded on other systems for viewing or printing the document.

  • The font cannot be modified, embedded, or exchanged in any way without obtaining explicit permission from the legal owner.

This page provides information on how to extract information about license restrictions in TrueType format fonts. The rest of the code snippets showing how to use the solution can be found in the Aspose Github Project project. This repository contains numerous C++ code examples. To view the license and other embedded information in a font, try our Font Metadata cross-platform application.

To extract embedded license we need:

  • Aspose.Font for C++ API which is a feature-rich, powerful and easy-to-use document manipulation and conversion API.

  • 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++:

  1. Specify the font that needs to be checked.
  2. Create an instance of the FontDefinition Class and pass in the font type and the font file information. The font file is then opened using the Open() Method.
  3. Check if the font has an OS/2 table, which is where the licensing information is stored. Retrieve the license flags using the GetLicenseFlags() Method if there are any. The code then detects the type of embedding that is permitted.

C++ Code for detecting licensing information in fonts

    using Aspose::Font::Ttf;
    //Font to check
    System::String fileName = dataDir + u"Montserrat-Regular.ttf";
    //Font file name with the full path
    
    System::SharedPtr<FontDefinition> fd = System::MakeObject<FontDefinition>(Aspose::Font::FontType::TTF, System::MakeObject<FontFileDefinition>(u"ttf", System::MakeObject<FileSystemStreamSource>(fileName)));
    System::SharedPtr<TtfFont> font = System::DynamicCast_noexcept<Aspose::Font::Ttf::TtfFont>(Aspose::Font::Font::Open(fd));
    System::SharedPtr<LicenseFlags> licenseFlags;
    if (font->get_TtfTables()->get_Os2Table() != nullptr)
    {
        licenseFlags = font->get_TtfTables()->get_Os2Table()->GetLicenseFlags();
    }
    
    if (licenseFlags == nullptr || licenseFlags->get_FSTypeAbsent())
    {
        System::Console::WriteLine(System::String::Format(u"Font {0} has no embedded license restrictions", font->get_FontName()));
    }
    else
    {
        if (licenseFlags->get_IsEditableEmbedding())
        {
            System::Console::WriteLine(System::String::Format(u"Font {0} may be embedded, and may be temporarily loaded on other systems.", font->get_FontName()) + u" In addition, editing is permitted, including ability to format new text" + u" using the embedded font, and changes may be saved.");
        }
        else if (licenseFlags->get_IsInstallableEmbedding())
        {
            System::Console::WriteLine(System::String::Format(u"Font {0} may be embedded, and may be permanently installed", font->get_FontName()) + u" for use on a remote systems, or for use by other users.");
        }
        else if (licenseFlags->get_IsPreviewAndPrintEmbedding())
        {
            System::Console::WriteLine(System::String::Format(u"Font {0} may be embedded, and may be temporarily loaded", font->get_FontName()) + u"  on other systems for purposes of viewing or printing the document.");
        }
        else if (licenseFlags->get_IsRestrictedLicenseEmbedding())
        {
            System::Console::WriteLine(System::String::Format(u"Font {0} must not be modified, embedded or exchanged in any manner", font->get_FontName()) + u" 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.