Ekstrak lisensi font tertanam

.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#:

  1. Specify the font that needs to be checked.
  2. 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. Apa itu lisensi font?

Ini adalah dokumen untuk menyatakan apa yang dapat dilakukan dengan font, batasan penggunaan, dan kelonggaran, dan hak cipta.

2. Apakah Anda perlu melisensikan font?

Seperti perangkat lunak lainnya, font dilindungi oleh hak cipta dan karenanya dilisensikan. Bagaimanapun, beberapa font berlisensi dapat digunakan untuk kebutuhan komersial secara gratis.

3. Bisakah saya menggunakan font secara komersial?

Ya, font dapat digunakan secara komersial baik berbayar maupun gratis. Lisensi juga mencakup jenis informasi semacam itu.

4. Bagaimana cara memeriksa lisensi font?

Untuk melihat apakah font menyertakan informasi lisensi secara online, Anda dapat menggunakan aplikasi Font Metadata . Di sana Anda akan melihat informasi seperti Deskripsi Lisensi, Url Info Lisensi, dan Pemberitahuan Hak Cipta. Untuk mendapatkan informasi tersebut secara terprogram, Anda perlu menggunakan properti Kelas LicenseFlag .