データを読み込んで抽出します| C++
Contents
[
Hide
Show
]ディスクからタイプ1フォントをロードします
C ++ APIのAspose.Fontでは、デジタルストレージに保存されているファイルから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));