Load and Extract Data | API Solution for .NET
Contents
[
Hide
Show
]Load Type1 Font from Disc
Aspose.Font for .NET API lets you read Type1 Font types from files stored in your digital storage. Type1 font files stored on disc can be loaded by using the following steps.
- Define a new object of FontDefinition class
- Specify FontType as Type1 and FontFileDefinition as pfb
- Create a Type1Font object and open the font file from FontDefinition object defined in the earlier step
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;