检测嵌入的许可信息

强大的 C++ API 解决方案用于检测字体的许可信息。使用 Aspose.Font for C++ 发掘隐藏价值:轻松提取嵌入的许可信息!

 

释放许可信息提取的强大能力!我们先进的 C++ API 解决方案将帮助您轻松提取嵌入的许可信息。它使用高级算法提取许可信息,确保您拥有最可靠的数据。无论是嵌入在文档、媒体文件还是软件中,我们的 API 都支持广泛的文件格式。无论您是初创公司还是大型企业,我们的 API 均可扩展以满足您的许可信息提取需求。采用 C++ 构建,实现无缝集成,API 能够轻松融入您现有的软件应用和工作流。不要让嵌入的许可信息被隐藏或未被充分利用。使用我们的 C++ API 解决方案,提升您的许可管理和知识产权保护工作。获取免费试用,以确保 Aspose.Font 是您需要的工具。

需要记住的是,字体被视为软件,因此必须付费才能合法使用。虽然有一些免费字体,但大多数不是。为确保您使用字体符合版权法规定,必须购买许可证。

字体许可证是合法以特定方式使用字体的必要条件,例如在网站、印刷品或软件中使用。没有适当的许可证,以某些方式使用字体可能会侵犯字体创作者或所有者的权益。字体许可证定义了字体使用的条款和条件。字体许可限制可能各不相同。有以下几种选项:

  • 字体可以嵌入并临时加载到其他系统上。这允许编辑,包括使用嵌入字体对新文本进行格式化,且任何更改都可以保存。

  • 字体可以嵌入并永久安装,以供远程系统或其他用户使用。

  • 字体可以嵌入并临时加载到其他系统上,以便查看或打印文档。

  • 未经合法所有者的明确许可,字体不得以任何方式进行修改、嵌入或交换。

本页提供了如何提取 TrueType 格式字体的许可限制信息的说明。其余展示如何使用该解决方案的代码片段可在 Aspose Github Project 项目中找到。该仓库包含大量 C++ 示例代码。要查看字体中的许可证及其他嵌入信息,请尝试我们的 Font Metadata 跨平台应用程序。

要提取嵌入的许可证,我们需要:

  • Aspose.Font for C++ API,它功能丰富、强大且易于使用的文档处理与转换 API。

  • 打开 NuGet 包管理器,搜索 Aspose.Font 并安装。您也可以在包管理器控制台中使用以下命令。

Package Manager Console Command


    PM> Install-Package Aspose.Font

使用 C++ 检测字体是否包含许可信息的步骤:

  1. 指定需要检查的字体。
  2. 创建 FontDefinition 类的实例,并传入字体类型和字体文件信息。然后使用 Open() 方法打开字体文件。
  3. 检查字体是否具有 OS/2 表,该表存储许可信息。如果存在,使用 GetLicenseFlags() 方法检索许可标志。代码随后会检测允许的嵌入类型。

用于检测字体许可信息的 C++ 代码

    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.");
        }
    }



常问问题

1. 什么是字体许可证?

它是一份声明字体用途、使用限制、许可和版权的文件。

2. 您需要许可字体吗?

与任何其他软件一样,字体受版权保护,因此需要获得许可。不管怎样,一些授权字体可以免费用于商业需求。

3. 我可以将字体用于商业用途吗?

是的,字体可以用于商业用途,无论是付费还是免费。许可证也包含此类信息。

4. 如何查看字体授权?

要在线查看字体是否包含许可证信息,您可以使用 字体元数据 应用程序。您将在其中看到许可证说明、许可证信息 URL 和版权声明等信息。要以编程方式获取此类信息,您需要使用 LicenseFlag 类的属性。