加载并提取数据| .NET

来自光盘的加载类型1字体

适用于 .NET 的 Aspose.Font API使您可以从存储在数字存储中的文件中读取Type1字体类型。可以使用以下步骤加载存储在光盘上的Type1字体文件。

  1. 构建 Type1 字体的完整文件路径(例如,string fileName = Path.Combine(dataDir, “courier.pfb”);)。这可确保跨平台路径处理正确。
  2. 创建描述 .pfb 格式的 FontFileDefinition 和该文件的 FileSystemStreamSource,然后使用 FontType.Type1 构建 FontDefinition
  3. 使用 Aspose.Font.Font.Open(fd) 打开字体,并将结果转换为 Type1Font
1// For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-.NET
2string fileName = dataDir + "courier.pfb"; //Font file name with full path
3
4FontDefinition fd = new FontDefinition(FontType.Type1, new FontFileDefinition("pfb", new FileSystemStreamSource(fileName)));
5Type1Font font = Aspose.Font.Font.Open(fd) as Type1Font;

Have any questions about Aspose.Font?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.