加载并提取数据| C++
Contents
[
Hide
Show
]来自光盘的加载类型1字体
Aspose.Font 适用于C++ api允许您从存储在数字存储中的文件中读取Type1字体类型。可以使用以下步骤加载存储在光盘上的Type1字体文件。
- 创建一个新的fontdefinition类的对象
- 将fonttype用作Type1,将FontfiledEfinition作为PFB
- 定义一个type1font对象,然后从早期步骤中定义的fontdefinition对象打开字体文件
1For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-C
2System::String fileName = dataDir + u"courier.pfb";
3//Font file name with full path
4
5System::SharedPtr<FontDefinition> fd = System::MakeObject<FontDefinition>(Aspose::Font::FontType::Type1, System::MakeObject<FontFileDefinition>(u"pfb", System::MakeObject<FileSystemStreamSource>(fileName)));
6System::SharedPtr<Type1Font> font = System::DynamicCast_noexcept<Aspose::Font::Type1::Type1Font>(Aspose::Font::Font::Open(fd));