データを読み込んで抽出します| JavaのAPIソリューション
Contents
[
Hide
Show
]ディスクからタイプ1フォントをロードします
Java APIのAspose.Fontでは、デジタルストレージに保存されているファイルからType1フォントタイプを読み取ることができます。ディスクに保存されているType1フォントファイルは、次の手順を使用してロードできます。
- FontDefinitionクラスの新しいオブジェクトを定義します
- fonttypeをtype1として指定し、fontfiledefinitionをpfbとして指定します
- Type1Fontオブジェクトを作成し、以前のステップで定義されたfontDefinitionオブジェクトからフォントファイルを開きます
1// For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-Java
2String fileName = Utils.getDataDir() + "courier.pfb"; //Font file name with full path
3
4FontDefinition fd = new FontDefinition(FontType.Type1, new FontFileDefinition("pfb", new FileSystemStreamSource(fileName)));
5 Type1Font font = (Type1Font) Font.open(fd);