加载并提取数据 | Java

Contents
[ Hide Show ]

从光盘加载 Type1 字体

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

1String fileName = Paths.get(getDataDir(), "..", "Type1", "courier.pfb").normalize().toString();
2FontDefinition fd = new FontDefinition(FontType.Type1,
3        new FontFileDefinition("pfb", new FileSystemStreamSource(fileName)));
4Type1Font font = (Type1Font) Font.open(fd);